Search Postgresql Archives

Re: Shorthand syntax for triggers

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

 



On 10/11/2012 12:22 AM, Joe Van Dyk wrote:

3. Triggers can access a special CHANGED value that's either NEW for
insert or updates, or OLD for deletes.

I'm not a big fan of the prior comments about small syntax changes, but this would simplify quite a bit of code. I'd *really* like a way to refer to "NEW for INSERT or UPDATE, OLD for DELETE" as an implicit automatic variable.

I do see the appeal of making trigger functions anonymous, but I really doubt it's worth the hassle.

4. Default for 'after insert' triggers is to return null, as I believe
it doesn't matter what you return here.

This is a trivial convenience, but not one I'd be against.

5. Way less repetitive typing.

If you're repeating the same triggers over and over you may want to look at writing them to be re-usable. See eg:

    http://wiki.postgresql.org/wiki/Audit_trigger_91plus

--
Craig Ringer



--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[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