Re: Rule uses wrong value

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Boes <jboes(at)nexcerpt(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Rule uses wrong value
Date: 2004-10-12 14:31:54
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Jeff Boes <jboes(at)qtm(dot)net> writes:
> It appears that the rule is inserting the row copies into
> job_queue_trace with a job_id value that is one higher than the job_id
> from the original row. Almost as though it was re-evaluating the
> sequence ...

No kidding. A rule is a macro and therefore has the usual risks of
multiple evaluations of arguments.

The only way to do what you want is with a trigger.

regards, tom lane

In response to


Browse pgsql-general by date

  From Date Subject
Next Message Alejandro Lopez-Valencia 2004-10-12 14:34:04 Re: [ANNOUNCE] Changes to CVS requires Fresh Checkout
Previous Message Tom Lane 2004-10-12 14:30:12 Re: update query confusion