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

Triggers with DO functionality

From: Thom Brown <thom(at)linux(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Triggers with DO functionality
Date: 2012-02-17 13:22:14
Message-ID: CAA-aLv4m=f9cc1zcUzM49pE8+2NpytUDraTgfBmkTOkMN_wO2w@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Hi,

This may have already been discussed before, but I can't find any
mention of it.  Would it be desirable to add support for triggers that
contain their own anonymous functions (i.e. DO)?

So instead of

CREATE TRIGGER...
EXECUTE PROCEDURE functioname();

you'd have:

CREATE TRIGGER...
DO $$
...
$$;

The purpose being to only have a single statement to set up the
trigger rather than setting up a separate trigger function which will
unlikely be re-used by other triggers... or is this of dubious
benefit?

-- 
Thom

Responses

pgsql-hackers by date

Next:From: Dimitri FontaineDate: 2012-02-17 13:31:56
Subject: Re: Command Triggers
Previous:From: Dimitri FontaineDate: 2012-02-17 13:19:21
Subject: Re: Command Triggers

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