Skip site navigation (1) Skip section navigation (2)

Re: Optional REFERENCES Feature in CREATE TRIGGER Command

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: hyip(at)site(dot)uottawa(dot)ca
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Optional REFERENCES Feature in CREATE TRIGGER Command
Date: 2004-12-13 02:49:52
Message-ID: 200412130249.iBD2nqv02443@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
This has been saved for the 8.1 release:

	http:/momjian.postgresql.org/cgi-bin/pgpatches2

---------------------------------------------------------------------------

hyip(at)site(dot)uottawa(dot)ca wrote:
> Hi,
> 
> The attached patch adds the optional REFERENCES syntax in CREATE TRIGGER
> statement to make an automatic alias for OLD/NEW record during trigger
> setup.  The implementation of this new feature makes CREATE TRIGGER
> command more compatible to SQL standard, and allows the future
> implementation of executing SQL commands in trigger action.
> 
> After the implementation, the extended syntax of statement is as follows.
> 
> CREATE TRIGGER name BEFORE|AFTER
>     INSERT|DELETE|UPDATE [OR...] ON tablename
>     [REFERENCING OLD|NEW [AS] identifier]
>     [FOR [EACH] ROW|STATEMENT]
>     EXECUTE PROCEDURE funcname (arguments)
> 
> The patch will also update two columns, condition_reference_old_table and
> condition_reference_new_table with alias names of the OLD/NEW record in
> the Triggers table of the information schema.

[ Attachment, skipping... ]

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>       joining column's datatypes do not match

-- 
  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

Responses

pgsql-patches by date

Next:From: Tom LaneDate: 2004-12-13 03:10:50
Subject: Re: Optional REFERENCES Feature in CREATE TRIGGER Command
Previous:From: Tom LaneDate: 2004-12-13 00:34:04
Subject: Re: pg_get_viewdef returns one paren too much

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group