Re: CREATE RULE ON UPDATE/DELETE

From: "Aasmund Midttun Godal" <postgresql(at)envisity(dot)com>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: pgsql-hackers(at)postgresql(dot)org, joel(at)joelburton(dot)com, pgsql-sql(at)postgresql(dot)org
Subject: Re: CREATE RULE ON UPDATE/DELETE
Date: 2001-10-21 22:26:03
Message-ID: 20011021222603.10841.qmail@ns.krot.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

Yes, I agree perfectly... I never thought of that! I would really like it if some more info was added to the docs regarding info on rules and triggers. The section on update rules is quite good, but some more would never hurt. One point in the trigger vs rules section which at least to me is very important is the simple fact that you cannot have a trigger on a select... Ok I understand why - but it took some time...

Thank you for answering my questions!

regards,

Aasmund.
On Sun, 21 Oct 2001 12:47:41 -0400, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Joel Burton <joel(at)joelburton(dot)com> writes:
>
>
> Surely you'd need something like
>
> CREATE RULE dbl_update AS ON UPDATE TO dbl DO INSTEAD UPDATE raw SET
> id = NEW.id / 2, name = NEW.name WHERE OLD.id = id * 2;
>
> (untested...)
>
> regards, tom lane

Aasmund Midttun Godal

aasmund(at)godal(dot)com - http://www.godal.com/
+47 40 45 20 46

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Steven Vajdic 2001-10-22 00:47:25 PostgreSQL 7.1.3 installation on Windows platforms
Previous Message Tom Lane 2001-10-21 20:18:25 Re: Error while restoring database

Browse pgsql-sql by date

  From Date Subject
Next Message Mayuresh Kadu 2001-10-22 06:36:21 Auto Increment
Previous Message Aasmund Midttun Godal 2001-10-21 22:12:55 Re: oid's in views.