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