bug in rule?

Started by sferriolabout 22 years ago2 messagesgeneral
Jump to latest
#1sferriol
sylvain.ferriol@imag.fr

hello i'm using postgres 7.2.1
and i'm using rule

example:
create rule test_rule
as on insert to test
do instead
(insert into test2
(select NEW.id where NEW.id='1'));

this works but the return string in psql is false
example:
insert into test(id) values ('2');
INSERT 0 0

normal, '2' is different from '1'

but
insert into test(id) values ('1');
INSERT 0 0

bug, it instert a line in table test2
select * from test2;
id
----
1
so the return must be
INSERT 0 1

IS IT A BUG?

sylvain

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: sferriol (#1)
Re: bug in rule?

sferriol <sylvain.ferriol@imag.fr> writes:

hello i'm using postgres 7.2.1

^^^^^

This was fixed some time ago ... but not *that* long ago. Update.

regards, tom lane