Re: Rules and Views

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Rules and Views
Дата
Msg-id 26462.1002635859@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Rules and Views  ("Travis Hoyt" <thoyt@npc.net>)
Список pgsql-novice
"Travis Hoyt" <thoyt@npc.net> writes:
> create rule ins_sun_u as on insert
> to sun_u do instead insert into sardata values ( usr, sys, wio,
> idle, time, systemid );
> ERROR:  Attribute 'usr' not found

You need to write "new.usr", etc.  Essentially, "new" and "old" are
record variables referring to the about-to-be-inserted row (in INSERT
or UPDATE rules) and the about-to-be-deleted row (in UPDATE or DELETE).
Even though sun_u is a view not a real table, you still have to follow
the syntax...

            regards, tom lane

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

Предыдущее
От: "Travis Hoyt"
Дата:
Сообщение: Rules and Views
Следующее
От: "Josh Berkus"
Дата:
Сообщение: Re: JDBC ResultSet