Re: Rule/currval() issue - Mailing list pgsql-sql

From Tom Lane
Subject Re: Rule/currval() issue
Date
Msg-id 28311.984593358@sss.pgh.pa.us
Whole thread Raw
In response to Rule/currval() issue  (Tim Perdue <tim@perdue.net>)
Responses Re: Rule/currval() issue  (Tim Perdue <tim@perdue.net>)
List pgsql-sql
Tim Perdue <tim@perdue.net> writes:
> This is related to the plpgsql project I was working on this morning. I'm
> trying to create a rule, so that when a row is inserted into a certain table,
> we also create a row over in a "counter table". The problem lies in getting
> the primary key value (from the sequence) so it can be inserted in that
> related table.

You probably should be using a trigger, not a rule at all.
        regards, tom lane


pgsql-sql by date:

Previous
From: Andrew Perrin
Date:
Subject: Re: Rule/currval() issue
Next
From: Tim Perdue
Date:
Subject: Re: Rule/currval() issue