bug in rule? - Mailing list pgsql-general

From sferriol
Subject bug in rule?
Date
Msg-id 404F14DE.1070204@imag.fr
Whole thread Raw
Responses Re: bug in rule?
List pgsql-general
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







Attachment

pgsql-general by date:

Previous
From: Dexter Tad-y
Date:
Subject: [NEWBIE] need help optimizing this query
Next
From: Richard Huxton
Date:
Subject: Re: Sudden semi-deterministic disconnection between queries