"marc persuy" <marc.persuy@wanadoo.fr> writes:
> what I mean is if I use a rule to execute any action,
> the rule should report an error to the client if, for any reason, this
> action fails.
It does.
> inserting into my_view will always return a sucess condition,
> even if you try to use it to insert a record with an already existing
> primary key.
Oh?
regression=# create table foo (f1 int primary key);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'foo_pkey' for table 'foo'
CREATE TABLE
regression=# create view v as select * from foo;
CREATE VIEW
regression=# create rule v_ins as on insert to v do instead
regression-# insert into foo values(new.f1);
CREATE RULE
regression=# insert into v values (1);
INSERT 149486 1
regression=# insert into v values (1);
ERROR: Cannot insert a duplicate key into unique index foo_pkey
regression=#
I don't see a problem.
regards, tom lane