Re: Release changes

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: Release changes
Дата
Msg-id 3F2FE474.7020701@joeconway.com
обсуждение исходный текст
Ответ на Re: Release changes  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: Release changes  (Andreas Pflug <pgadmin@pse-consulting.de>)
Список pgsql-hackers
Bruce Momjian wrote:
> How are statement level triggers supposed to work?  Are they just
> triggers deferred until the end of the statement?  You mentioned access
> to the affected rows, but I don't understand how that is supposed to
> happen.

I'm not sure this is a fair assessment of statement level triggers. Yes, 
in MSSQL you can access the rows involved in the statement, but in 
Oracle you cannot (emphasis added):

"Accessing Column Values in Row Triggers
Within a trigger body of a *row trigger*, the PL/SQL code and SQL 
statements have access to the old and new column values of the current 
row affected by the triggering statement..."

See:
http://www.engin.umich.edu/caen/wls/software/oracle/appdev.901/a88876/adg13trg.htm#526

MSSQL does not have row level triggers at all (I know they didn't in 
6.5, and looking at the help file it doesn't appear that they were added 
even in MSSQL 2000), so access at the statement level is needed to do 
anything useful at all.

"deleted and inserted are logical (conceptual) tables. They are 
structurally similar to the table on which the trigger is defined, that 
is, the table on which the user action is attempted, and hold the old 
values or new values of the rows that may be changed by the user action."

Joe



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

Предыдущее
От: Andreas Pflug
Дата:
Сообщение: Re: Release changes: statement level triggers
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: logging stuff