"ALSO" keyword to "CREATE RULE" patch

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: "ALSO" keyword to "CREATE RULE" patch
Date: 2004-03-01 08:10:54
Message-ID: Pine.LNX.4.58.0403010908500.28778@sablons.cri.ensmp.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-patches


Dear patchers,

Please find attached a small patch to add an optionnal "ALSO" keyword
to the "CREATE RULE" syntax.

The "ALSO" keyword can be used where "INSTEAD" would be used,
to mean the opposite, i.e. the current default behavior of rules
which adds operations to the current one. IMHO, it makes the
intended behavior much clearer for the basic user (say, me;-).

CREATE RULE some_table_del AS
ON DELETE TO some_table DO ALSO
(
DELETE FROM this_other_table WHERE id=old.id;
);

Of course, the absence of the "ALSO" keyword preserves the previous
behavior... that is it behaves the same as with the "ALSO" keyword.

This patch was made against 7.4.1 with the "difforig" script
provided by postgresql.

It adds "ALSO" keyword in the parser code (two lines), fixes somehow the
documentation and sql help, and modifies four of the "RULE"
test cases to use this keyword instead of the default nothing-ness.

It validated for me with a "make check".

Have a nice day,

--
Fabien Coelho - coelho(at)cri(dot)ensmp(dot)fr

Attachment Content-Type Size
also_keyword.diff text/plain 10.9 KB

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Bruce Momjian 2004-03-03 19:03:15 Re: "ALSO" keyword to "CREATE RULE" patch
Previous Message Kris Jurka 2004-03-01 04:48:59 new PDFs of 7.4 docs

Browse pgsql-patches by date

  From Date Subject
Next Message Fabien COELHO 2004-03-01 15:35:58 Foreign key type checking patch
Previous Message Andrew Dunstan 2004-02-29 18:09:45 log_line_info