Re: Rules/Trigges Trade-offs

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: PostgreSQL-SQL <pgsql-sql(at)postgreSQL(dot)org>
Cc: josh(at)agliodbs(dot)com, Jean-Luc Lachance <jllachan(at)nsd(dot)ca>
Subject: Re: Rules/Trigges Trade-offs
Date: 2002-12-07 03:43:02
Message-ID: 200212070343.gB73h2H14787@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-sql

Bruce Momjian wrote:
> > > > 3) There are no AFTER Rules, making, for example, a rule with a table
> > check on
> > > > the new data impractical, so you'd want to use Triggers or Constraints
> > >
> > > We have changed ordering in 7.3 where I think INSERT rules are _after_
> > > the insert.
> >
> > How would that work? What if I want to reject the insert?
>
> Uh, good question. I can't remember now what we re-ordered in 7.3, but
> I thought it had to do with rules.

OK, I found what I wanted. We made rules fire in alphabetical order in
7.3, and INSTEAD rules are not reordered to the font/back --- they are
treated just like any other rule and executed alphabetically.

I thought we had some problem with rules or triggers and OLD/NEW
handling, but I can't see any mention of that, and it must have been in
an older release.

The question of firing order is a good one and one that isn't asked very
often.

--
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-admin by date

  From Date Subject
Next Message Ross J. Reedstrom 2002-12-07 05:04:09 Re: [HACKERS] how to alter sequence.
Previous Message Bruce Momjian 2002-12-07 02:24:44 Re: Rules/Trigges Trade-offs

Browse pgsql-sql by date

  From Date Subject
Next Message D'Arcy J.M. Cain 2002-12-07 13:17:48 Re: [SQL] SELECT FOR UPDATE locks whole table
Previous Message Bruce Momjian 2002-12-07 02:24:44 Re: Rules/Trigges Trade-offs