Re: simple trigger question ... - Mailing list pgsql-sql

From Marc G. Fournier
Subject Re: simple trigger question ...
Date
Msg-id 20030403002922.Y71125@hub.org
Whole thread Raw
In response to Re: simple trigger question ...  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: simple trigger question ...  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Okay, so I do have to create the FUNCTION first, I can't do it without?
Can a TRIGGER pass an arg to the FUNCTION?

On Wed, 2 Apr 2003, Tom Lane wrote:

> "Marc G. Fournier" <scrappy@hub.org> writes:
> >> Er ... you just want to bump the sequence and throw away the actual
> >> value?  You don't want to store the value somewhere?
>
> > Correct
>
> Then you need something like (untested)
>
> CREATE FUNCTION mytrig() RETURNS TRIGGER AS '
> begin
>   perform nextval(''seq'');
>   return new;
> end' LANGUAGE plpgsql;
>
>             regards, tom lane
>



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: simple trigger question ...
Next
From: Tom Lane
Date:
Subject: Re: simple trigger question ...