From: Richard Huxton <dev@archonet.com>
To: Luca Rasconi <luca.rasconi@students.cefriel.it>
Cc: pgsql-sql@postgresql.org
Subject: Re: FW: help with serial
Date: Mon, 20 Jun 2005 11:10:10 +0100
Message-ID: <42B69602.4050309@archonet.com> (raw)
In-Reply-To: <000901c5757b$2b3b7030$19040a0a@cefriel.it>
References: <000901c5757b$2b3b7030$19040a0a@cefriel.it>
Luca Rasconi wrote:
>
> CREATE OR REPLACE RULE r1 AS
> ON INSERT TO TABLE_A DO INSERT INTO TABLE_B (uid)
> VALUES ((new.uid));
> how is it possible, why in a table 37 and in the other 37 + 1?
This is almost certainly the "nextval() evaluated twice" issue that
catches everyone out from time to time. Check the mailing-list archives
for discussion - it's because the rule acts as a macro, duplicating the
expression.
--
Richard Huxton
Archonet Ltd
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: dev@archonet.com, luca.rasconi@students.cefriel.it
Subject: Re: FW: help with serial
In-Reply-To: <42B69602.4050309@archonet.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox