Tom,

You indicate trigger, rather than rule.  Going by Momjian's book, he
indicates that rules are "...ideal for when the action affects other
tables."  Can you clarify why you would use a trigger for this?  I'm asking
because I have no clue how to use rules or triggers, but need one or the
other to modify a second table on inserts/deletes to the first table.  I'd
like to make the best choice first if possible.

Thanks,
Rob

> -----Original Message-----
> From: Tom Lane [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 14, 2001 11:09 AM
> To: Tim Perdue
> Cc: [EMAIL PROTECTED]
> Subject: Re: [SQL] Rule/currval() issue 
> 
> 
> Tim Perdue <[EMAIL PROTECTED]> 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
> 
> ---------------------------(end of 
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to 
> [EMAIL PROTECTED])
> 

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to