From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Stephen Frost <sfrost@snowman.net>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Subject: Re: Incorrect processing of CREATE TRANSFORM with DDL deparding
Date: Tue, 26 May 2015 11:41:40 -0300
Message-ID: <20150526144140.GT5885@postgresql.org> (raw)
In-Reply-To: <20150526020243.GU26667@tamriel.snowman.net>
References: <CAB7nPqQNS36enM2R=6P9FvKUu7t3k=2EjFkFBPnby==pLFqQ+w@mail.gmail.com>
<20150525155248.GG5885@postgresql.org>
<CAB7nPqR3oeggsoVqKrgvoS=mJCfH1qMbFHjCGj2RVLu0Nf7Sjg@mail.gmail.com>
<20150526020243.GU26667@tamriel.snowman.net>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Stephen Frost wrote:
> That said, I'm really not all that happy with the split between
> ProcessUtility() and ProcessUtilitySlow(). I've not said anything since
> I haven't got any great solutions to the issue, but it really is pretty
> grotty. I realize it might take a few extra cycles, but my thinking is
> along the lines of having an array or similar which we scan that
> indicates what is supported by deparse/event triggers, what isn't, etc,
> and then we operate based on that.. Perhaps an array which is indexed
> based on the NodeTag enum?
That doesn't work. Consider DropStmt for example; it is supported for
some object types, but not supported by others. There are a few other
commands for which this happens too. Also, NodeTag contains tags for
everything that can be a node: plan nodes for example, and for those it
doesn't even make sense to consider whether event triggers are
supported.
I suppose you could create a node type T_UtilityStmt and make all the
command nodes be sub-types of that one. But, except for the
ProcessUtility{Slow} code, it would be a loss in maintainability, ISTM,
and it would increase the size of every single utility node.
Now maybe with that you could get rid of (or centralize) various arrays;
see for example ObjectTypeMap and event_trigger_support, the calls to
pg_strcasecmp() in check_ddl_tag, EventTriggerSupportsObjectType() and
EventTriggerSupportsObjectClass() and
EventTriggerSupportsGrantObjectType() ...
Anyway this would solve the problem at hand anyway.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: alvherre@2ndquadrant.com, sfrost@snowman.net, michael.paquier@gmail.com
Subject: Re: Incorrect processing of CREATE TRANSFORM with DDL deparding
In-Reply-To: <20150526144140.GT5885@postgresql.org>
References: <CAB7nPqQNS36enM2R=6P9FvKUu7t3k=2EjFkFBPnby==pLFqQ+w@mail.gmail.com> <20150525155248.GG5885@postgresql.org> <CAB7nPqR3oeggsoVqKrgvoS=mJCfH1qMbFHjCGj2RVLu0Nf7Sjg@mail.gmail.com> <20150526020243.GU26667@tamriel.snowman.net> <20150526144140.GT5885@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox