Re: Release changes

From: Joe Conway <mail(at)joeconway(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Release changes
Date: 2003-08-05 17:08:04
Message-ID: 3F2FE474.7020701@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2003-08-05 17:37:18 Re: logging stuff
Previous Message Andreas Pflug 2003-08-05 17:01:48 Re: Release changes: statement level triggers