Mike Glover wrote:
Please enter a FULL description of your problem: ------------------------------------------------ The docs state (section
23.9):

If a non-NULL value is returned then the operation proceeds with that row
value. Note that returning a row value different from the original value of
NEW alters the row that will be inserted or updated.
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

the above suggests that returning NEW for a delete should cause the delete
to proceed.  In fact, I've found it necessary to return a record with the
row format of the table and all empty fields.
No, actually it suggests that returning NEW should cause an *update* or *insert* to proceed. In the case of a delete, NEW is not set. See a few lines above:

NEW
Data type RECORD; variable holding the new database row for INSERT/UPDATE
operations in ROW level triggers.

OLD
Data type RECORD; variable holding the old database row for UPDATE/DELETE
operations in ROW level triggers.

It is perhaps confusing, but probably necessary so that a single function can handle inserts, updates, and deletes (see TG_OP).

Joe


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Reply via email to