Re: [HACKERS] Possible TODO: allow arbitrary expressions in eventtrigger WHEN - Mailing list pgsql-hackers

From Robert Haas
Subject Re: [HACKERS] Possible TODO: allow arbitrary expressions in eventtrigger WHEN
Date
Msg-id CA+Tgmoaq10rN_mSqT7H3Xnzk8JOwPyLKw78kncxEfDvcQPXOgA@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Possible TODO: allow arbitrary expressions in event trigger WHEN  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Feb 13, 2017 at 10:34 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Jim Nasby <Jim.Nasby@BlueTreble.com> writes:
>> Is there a reason not to allow $SUBJECT? Specifically, it'd be nice to
>> be able to do something like WHEN tag LIKE 'ALTER%'.
>
> Seems like it would be a seriously bad idea for such an expression to be
> able to invoke arbitrary SQL code.  What if it calls a user-defined
> function that tries to do DDL?

Yeah.  I remember thinking about this and deciding that allowing real
expressions there was totally intractable.  I don't remember what all
the reasons were, but what Tom's talking about may have been at least
part of it.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: "Higuchi, Daisuke"
Date:
Subject: [HACKERS] new high availability feature for the system with both asynchronousand synchronous replication
Next
From: Michael Paquier
Date:
Subject: Re: [HACKERS] Re: [COMMITTERS] pgsql: Remove all references to "xlog"from SQL-callable functions in p