Re: [SQL] CREATE RULE ON UPDATE/DELETE - Mailing list pgsql-hackers

From Stephan Szabo
Subject Re: [SQL] CREATE RULE ON UPDATE/DELETE
Date
Msg-id Pine.BSF.4.21.0110210129570.41420-100000@megazone23.bigpanda.com
Whole thread Raw
List pgsql-hackers
> Don't think so.  I think the rule doesn't make any sense.
> NEW.id and OLD.id are probably dbl values, so saying OLD.id=id (where id
> is raw.id since that's the update table) isn't correct.  It probably
> should be OLD.id=id*2 (which seems to work for me, btw)  It's editing
> a different row than the one that's being selected.

I forgot to mention in this that I needed to made an additional change in
the rule to make the ids come out correct at the end :(.  The update set
id=NEW.id should be id=NEW.id/2 of course...  Otherwise the +10 becomes a
+20.




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [SQL] CREATE RULE ON UPDATE/DELETE
Next
From: Bill Studenmund
Date:
Subject: Re: Package support for Postgres