Le 14/11/2012 05:23, Josh Kupershmidt a écrit :
On Sun, Nov 11, 2012 at 3:52 PM, Louis-Claude Canon
<[email protected]> wrote:
the compatibility section of the "create trigger" page
(http://www.postgresql.org/docs/devel/static/sql-createtrigger.html) claims
that a missing functionality is the ability to define aliases for the "old"
and "new" rows or tables. If I am understanding this correctly, another
related missing functionality is that PostgreSQL does not allow the old and
new tables to be referenced for statement-level triggers (i.e., the "OLD
TABLE" that contains all the deleted/modified rows in case of
deletion/update). I think this is also worth noting as any workaround for it
seems to be more difficult (if possible at all) than for the missing alias
feature.
+1, it seems like a useful missing piece from the SQL:2011 standard.
Care to send a documentation patch?
Let me know if it requires a second round.
By the way, I can propose another patch regarding the transaction
isolation relatively to my previous post on pgsql-bugs.
Louis
>From db70531ab6cd7ecb95818e8286db62f9a9e5adf4 Mon Sep 17 00:00:00 2001
From: Louis-Claude Canon <[email protected]>
Date: Wed, 14 Nov 2012 22:02:21 +0100
Subject: [PATCH] Document the missing OLD/NEW TABLE trigger feature
The ability to refer to the collection of old and new rows (transition table)
as OLD TABLE and NEW TABLE for statement-level trigger is missing from the
SQL:2011 standard.
---
doc/src/sgml/ref/create_trigger.sgml | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/doc/src/sgml/ref/create_trigger.sgml b/doc/src/sgml/ref/create_trigger.sgml
index 0f87b1f..46be516 100644
--- a/doc/src/sgml/ref/create_trigger.sgml
+++ b/doc/src/sgml/ref/create_trigger.sgml
@@ -484,11 +484,22 @@ CREATE TRIGGER view_insert
<para>
The <command>CREATE TRIGGER</command> statement in
<productname>PostgreSQL</productname> implements a subset of the
- <acronym>SQL</> standard. The following functionality is currently missing:
+ <acronym>SQL</> standard. The following functionalities are currently
+ missing:
<itemizedlist>
<listitem>
<para>
+ <productname>PostgreSQL</productname> does not allow the old and new
+ tables to be referenced for statement-level triggers (i.e., the tables
+ that contains all the old and/or new rows, which are referred to as
+ <literal>OLD TABLE</literal> and <literal>NEW TABLE</literal> is the
+ <acronym>SQL</> standard).
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
SQL allows you to define aliases for the <quote>old</quote>
and <quote>new</quote> rows or tables for use in the definition
of the triggered action (e.g., <literal>CREATE TRIGGER ... ON
--
1.7.9.5
--
Sent via pgsql-docs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs