Re: Thoughts about updateable views

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Thoughts about updateable views
Дата
Msg-id 8876.1079993486@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Thoughts about updateable views  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: Thoughts about updateable views  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I was thinking we create an updatable view if possible, and throw an
> error if they try to insert/update/delete into a non-updatable view. 

Right.

> Right now we ignore such activity, but that seems wrong.

Nonsense.

regression=# create view bar as select * from foo;
CREATE VIEW
regression=# insert into bar values (1);
ERROR:  cannot insert into a view
HINT:  You need an unconditional ON INSERT DO INSTEAD rule.
regression=#

The only backwards-compatibility risk I see is if there's a manually
created ON-whatever rule; this probably has to override the automatic ones.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Thoughts about updateable views
Следующее
От: Bruce Momjian
Дата:
Сообщение: My plans