Search Postgresql Archives

Re: Supported plpgsql BEFORE ... EACH ROW behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Karl O. Pinc wrote:
Hi,

I want to write a plpgsql function for use as a
BEFORE ... EACH ROW function.  I want to modify
other tables even when the function returns NULL
and therefore the table on which the BEFORE
trigger is defined is not updated.

Sorry for being paranoid about this but I
want to double check before relying on
behavior that few people probably use.

I think it's fairly common, actually. Returning NULL is cancelling the update *of that row* rather than aborting the transaction, so all side-effects should always survive.

Otherwise you couldn't update 100 rows and just skip one or two by returning NULL from a before trigger.

--
  Richard Huxton
  Archonet Ltd


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux