From: Stephen Frost <sfrost@snowman.net>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
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 21:46:25 -0400
Message-ID: <20150527014625.GG26667@tamriel.snowman.net> (raw)
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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Alvaro,
* Alvaro Herrera (alvherre@2ndquadrant.com) wrote:
> 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.
Yeah, good points, all of them.
> 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.
I certainly agree that being able to centralize those arrays would be
nice. It has definitely struck me, more than once, that we've got quite
a few different arrays hanging around that might be better combined into
one or at least kept in the same area. If nothing else, it might help
minimize cases where individuals forget to update one or another of the
arrays.
Thanks!
Stephen
Attachments:
signature.asc (application/pgp-signature, 818B) download
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: sfrost@snowman.net, alvherre@2ndquadrant.com, michael.paquier@gmail.com
Subject: Re: Incorrect processing of CREATE TRANSFORM with DDL deparding
In-Reply-To: <20150527014625.GG26667@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> <20150526144140.GT5885@postgresql.org> <20150527014625.GG26667@tamriel.snowman.net>
* 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