Received: from Main.eurocom.od.ua (root@Main.EuroCom.Od.UA [212.15.128.6]) by hub.org (8.9.3/8.9.3) with ESMTP id KAA89650 for ; Tue, 2 May 2000 10:18:45 -0400 (EDT) (envelope-from gsmith@eurocom.od.ua) Received: from eurocom.od.ua (FarHost.EuroCom.Od.UA [212.15.128.42]) by Main.eurocom.od.ua (8.10.0/8.10.0) with ESMTP id e42EIVU18770 for ; Tue, 2 May 2000 17:18:32 +0300 Message-ID: <390EE3D6.1784C75B@eurocom.od.ua> Date: Tue, 02 May 2000 17:19:02 +0300 From: "Vladimir V. Zolotych" X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.5-15 i686) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: RULE bug? Content-Type: multipart/alternative; boundary="------------4C8E270A4511DA358000A977" X-Archive-Number: 200005/7 --------------4C8E270A4511DA358000A977 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit 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 --------------4C8E270A4511DA358000A977 Content-Type: text/html; charset=koi8-r Content-Transfer-Encoding: 7bit   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
  --------------4C8E270A4511DA358000A977--