Re: Return of INSTEAD rules

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Manfred Koizar <mkoi-pg(at)aon(dot)at>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Michael Paesold <mpaesold(at)gmx(dot)at>, PostgreSQL Hackers Mailing List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Return of INSTEAD rules
Date: 2002-10-04 16:53:11
Message-ID: 200210041653.g94GrBA15210@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> You can create as many rules as you want. One reasonably likely
> scenario is that you have a view, you make an ON INSERT DO INSTEAD
> rule to support insertions into the view (by inserting into some
> underlying table(s) instead), and then you add some not-INSTEAD
> rules to perform logging into other tables that aren't part of the
> view but just keep track of activity.
>
> You'd not want the logging activity to usurp the count result for this
> setup, I think, even if it happened last. (Indeed, that might be
> *necessary*, if for some reason it needed to access the rows inserted
> into the view's base table.)
>
> This approach would give us a general principle that applies in all
> cases: not-INSTEAD rules don't affect the returned command result.
> Perhaps that would answer Manfred's thought that we should be able
> to label which rules affect the result. If you have any INSTEAD rules,
> then it doesn't matter exactly how many you have, so you can mark them
> INSTEAD or not to suit your fancy.

Oh, I like that, and rules fire alphabetically, right?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-10-04 16:59:28 Re: Return of INSTEAD rules
Previous Message David Blood 2002-10-04 16:46:57 Pinning a table into memory