From: Peter Eisentraut <peter_e@gmx.net>
To: pgsql-committers@postgresql.org
Subject: pgsql: Remove objname/objargs split for referring to objects
Date: Mon, 06 Mar 2017 18:34:49 +0000
Message-ID: <E1ckxT7-0007Yx-KE@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
Remove objname/objargs split for referring to objects
In simpler times, it might have worked to refer to all kinds of objects
by a list of name components and an optional argument list. But this
doesn't work for all objects, which has resulted in a collection of
hacks to place various other nodes types into these fields, which have
to be unpacked at the other end. This makes it also weird to represent
lists of such things in the grammar, because they would have to be lists
of singleton lists, to make the unpacking work consistently. The other
problem is that keeping separate name and args fields makes it awkward
to deal with lists of functions.
Change that by dropping the objargs field and have objname, renamed to
object, be a generic Node, which can then be flexibly assigned and
managed using the normal Node mechanisms. In many cases it will still
be a List of names, in some cases it will be a string Value, for types
it will be the existing Typename, for functions it will now use the
existing ObjectWithArgs node type. Some of the more obscure object
types still use somewhat arbitrary nested lists.
Reviewed-by: Jim Nasby <Jim.Nasby@BlueTreble.com>
Reviewed-by: Michael Paquier <michael.paquier@gmail.com>
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/8b6d6cf853aab12f0dc2adba7c99c3e458662734
Modified Files
--------------
src/backend/catalog/objectaddress.c | 447 +++++++++++++++------------
src/backend/commands/alter.c | 33 +-
src/backend/commands/comment.c | 11 +-
src/backend/commands/dropcmds.c | 175 +++++------
src/backend/commands/extension.c | 13 +-
src/backend/commands/seclabel.c | 4 +-
src/backend/commands/tablecmds.c | 10 +-
src/backend/commands/typecmds.c | 2 +-
src/backend/nodes/copyfuncs.c | 16 +-
src/backend/nodes/equalfuncs.c | 16 +-
src/backend/parser/gram.y | 440 ++++++++++++--------------
src/backend/parser/parse_utilcmd.c | 14 +-
src/include/catalog/objectaddress.h | 8 +-
src/include/commands/extension.h | 2 +-
src/include/nodes/parsenodes.h | 24 +-
src/test/regress/expected/event_trigger.out | 3 -
src/test/regress/expected/object_address.out | 24 +-
src/test/regress/sql/event_trigger.sql | 3 -
18 files changed, 610 insertions(+), 635 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
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-committers@postgresql.org
Cc: peter_e@gmx.net
Subject: Re: pgsql: Remove objname/objargs split for referring to objects
In-Reply-To: <E1ckxT7-0007Yx-KE@gemulon.postgresql.org>
References: <E1ckxT7-0007Yx-KE@gemulon.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