Updateable VIEWS and the manual

Started by Thomas Kellererover 13 years ago3 messagesgeneral
Jump to latest
#1Thomas Kellerer
spam_eater@gmx.net

Hi,

I just noticed the following statement in the CREATE VIEW documentation (9.2 and 9.1):

Currently, views are read only: the system will not allow an insert,
update, or delete on a view. You can get the effect of an updatable view by
creating rules that rewrite inserts, etc. on the view into appropriate actions
on other tables. For more information see CREATE RULE.

Wouldn't it make more sense to refer to INSTEAD OF triggers?

My understanding was that an INSTEAD OF trigger was preferred over a rule nowadays.

Regards
Thomas

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Merlin Moncure
mmoncure@gmail.com
In reply to: Thomas Kellerer (#1)
Re: Updateable VIEWS and the manual

On Wed, Nov 28, 2012 at 4:43 PM, Thomas Kellerer <spam_eater@gmx.net> wrote:

Hi,

I just noticed the following statement in the CREATE VIEW documentation (9.2
and 9.1):

Currently, views are read only: the system will not allow an insert,
update, or delete on a view. You can get the effect of an updatable view
by
creating rules that rewrite inserts, etc. on the view into appropriate
actions
on other tables. For more information see CREATE RULE.

Wouldn't it make more sense to refer to INSTEAD OF triggers?

My understanding was that an INSTEAD OF trigger was preferred over a rule
nowadays.

yup.

merlin

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Thomas Kellerer (#1)
Re: Updateable VIEWS and the manual

Thomas Kellerer <spam_eater@gmx.net> writes:

I just noticed the following statement in the CREATE VIEW documentation (9.2 and 9.1):

Currently, views are read only: the system will not allow an insert,
update, or delete on a view. You can get the effect of an updatable view by
creating rules that rewrite inserts, etc. on the view into appropriate actions
on other tables. For more information see CREATE RULE.

Wouldn't it make more sense to refer to INSTEAD OF triggers?

Done, thanks for pointing it out.

regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general