On Thu, Dec 3, 2009 at 2:56 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Lonni J Friedman <netllama(at)gmail(dot)com> writes:
>> I tried to use the trigger example here, but it silently fails to work:
> That example seems to be lacking a CREATE TRIGGER command, so
> there's nothing telling the system to call the function.
> It never worked as given --- read the whole thread.
I thought that I had read the whole thread, but never saw any mention
of a missing 'create trigger' command. Anyway, once I created the
trigger, it worked perfectly. For the sake of posterity, the create
trigger command that I used was (my table name is appstracker, and my
function name is appstracker_incrementer) :
create trigger appstracker_incrementer_trigger before update on
appstracker FOR EACH ROW EXECUTE PROCEDURE appstracker_incrementer() ;
> The only really out-of-date part of it is that nowadays
> "returns trigger" is preferred to "returns opaque".
> But you need CREATE TRIGGER.
And its even nice enough to warn me about this:
WARNING: changing return type of function appstracker_incrementer
from "opaque" to "trigger"
In response to
pgsql-novice by date
|Next:||From: A B||Date: 2009-12-05 08:36:16|
|Subject: Is autovaccum lazy?|
|Previous:||From: Tom Lane||Date: 2009-12-03 22:56:06|
|Subject: Re: auto-increment integer field for each row |