public inbox for [email protected]
help / color / mirror / Atom feedFrom: James Cloos <[email protected]>
To: [email protected]
Subject: plperl and triggers
Date: Sun, 10 Sep 2006 23:41:38 -0400
Message-ID: <[email protected]> (raw)
The manual says that $_TD->{old} contains the old value of the row
being operated on in a trigger, and $_TD->{new} the new value to be
used istead.
When using plpgsql I find that the equivs OLD and NEW do work that
way, but with plperlu there was only $_TD->{new}.
Perhaps {old} is only set on an update. Or on an AFTER trigger to
an insert?
Or perhaps {old} only gets set if {new} is altered?
Whatever the reality, the doc should be fixed to explain exactly
when {old} and {new} exist and their semantics.
Liberal use of, eg, elog(WARNING, Dumper(\$_TD)) made it easy to
get my trigger function working as desired, but it would be cool
to document the details....
(In general, the docs are great. I do sometimes have to read a
given section more than once -- or thrice -- to get it, but that
is as much due to fatigue as anything. And I am one of those who
tend to learn new stuff better when reading from paper than from
emitive displays like lcds or crts, for whatever reason.)
(Or maybe I'm just getting old. ;-)
-JimC
--
James Cloos <[email protected]> OpenPGP: 0xED7DAEA6
view thread (3+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: plperl and triggers
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox