Re: [GENERAL] seq. DEFAULT values and rules

2013-07-03 Thread Tom Lane
salah jubeh writes: > Is this a bug ? No, it's a documented, operating-as-designed behavior. Rules are macros and therefore have all the usual multiple-evaluation-of-arguments hazards. If you just want to propagate data from one table to another, a trigger is often a better choice, or at least

[GENERAL] seq. DEFAULT values and rules

2013-07-03 Thread salah jubeh
Is this a bug ?,   the new.a_id in my opinion should not be replaced here with nextval () function but with the actual value returned by the sequence. Please have this minimal example . CREATE TABLE a (     a_id serial primary key ); CREATE TABLE b (     b_id serial Primary key ); CREATE