Re: Rule/currval() issue

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tim Perdue <tim(at)perdue(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Rule/currval() issue
Date: 2001-03-14 18:09:18
Message-ID: 28311.984593358@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Tim Perdue <tim(at)perdue(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tim Perdue 2001-03-14 18:13:35 Re: Rule/currval() issue
Previous Message Andrew Perrin 2001-03-14 18:04:42 Re: Rule/currval() issue