Re: Bug #485: strange behavior when creting rules with - Mailing list pgsql-bugs

From Stephan Szabo
Subject Re: Bug #485: strange behavior when creting rules with
Date
Msg-id Pine.BSF.4.21.0110170458300.21535-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Bug #485: strange behavior when creting rules with serial id  (pgsql-bugs@postgresql.org)
List pgsql-bugs
On Wed, 17 Oct 2001 pgsql-bugs@postgresql.org wrote:

> Tony Tomov (ttomov@abs.bg) reports a bug with a severity of 2
> The lower the number the more severe it is.
>
> Short Description
> strange behavior when creting rules  with serial id
>
> Long Description
> I do not know if this is a bug, but for me this is a strange behavior.
> I will describe the following process.

Yep. Both the rule's new.id and the actual id are going to increment the
counter, since they'll both see the nextval for the serial sequence, the
new.id is going to shove in whatever is specified for the value exactly
as it was specified, so new.id is nextval(...) not the numeric result
of nextval(...).  You're probably going to want to use a trigger instead.

pgsql-bugs by date:

Previous
From: pgsql-bugs@postgresql.org
Date:
Subject: Bug #485: strange behavior when creting rules with serial id
Next
From: Tony Tomov
Date:
Subject: strange behavior when creting rules