Re: [BUGS] double insert on inherited table with where constraint based on sequence

2006-07-19 Thread Tom Lane
"Andrew Hammond" <[EMAIL PROTECTED]> writes: > Rules: > t2_part AS > ON INSERT TO t2 >WHERE new.id > 10 DO INSTEAD INSERT INTO t2_child (id, name) > VALUES (new.id, new.name) "new.id" is replaced by "nextval('t2_id_seq'::regclass)" each time it appears ... which will be four separat

[BUGS] double insert on inherited table with where constraint based on sequence

2006-07-19 Thread Andrew Hammond
Perhaps I'm missing something here, but it looks like I'm getting an insert into both the parent and child tables when my RULE's where clause is based on a DEFAULT generated from a sequence. It looks like nextval on the sequence is called 3 times for every insert. I don't know if this is properly