From: Vladimir V. Zolotych <gsmith@eurocom.od.ua>
To: pgsql-admin@postgresql.org
Subject: RULE bug?
Date: Tue, 02 May 2000 17:19:02 +0300
Message-ID: <390EE3D6.1784C75B@eurocom.od.ua> (raw)
Hello all,
Due to bug (?) I can't trace insertions into
table with SERIAL. E.g., if a table contains column
of a type SERIAL with name 'id', when RULE activated
NEW.id equals X, but real 'id' of a inserted record is X+1.
(Here the RULE definition:
CREATE RULE log_orders AS ON INSERT TO orders
DO INSERT INTO orders_log VALUES (
NEW.id,
'I',
--............................
'now'::text,
getpgusername());
)
Having that log table with invalid (differed by 1) 'id' I've
tried:
select o.* from orders o, orders_log L where (o.id = (L.order_id + 1));
This is didn't work too!
Can anybody help?
Thanks!
--
Vladimir Zolotych gsmith@eurocom.od.ua
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: gsmith@eurocom.od.ua
Subject: Re: RULE bug?
In-Reply-To: <390EE3D6.1784C75B@eurocom.od.ua>
References: <390EE3D6.1784C75B@eurocom.od.ua>
* 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