Re: ERROR action extension for rules?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ERROR action extension for rules?
Date: 2004-04-20 17:06:53
Message-ID: 20403.1082480813@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> writes:
> I'm trying to use some RULE as simple and maybe slower TRIGGER, so as to
> make it impossible for a row to be modified once a boolean is set to lock
> it.
> ...
> However I thing that this would look much better to write simply:

> CREATE RULE PasTouche AS ON UPDATE TO foo
> WHERE old.locked=TRUE
> DO INSTEAD ERROR;

This would be sensible if rules were actually reasonable substitutes for
triggers, but they are not. If you check the archives you will find
many many cases where people tried to do this sort of thing, and got
burned by the fundamental semantic differences ...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message ken 2004-04-20 17:20:54 Reporting a security hole
Previous Message Bruce Momjian 2004-04-20 16:50:16 Re: pg_autovacuum crashes when query fails for temp tables