Thread: RULE bug?
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