pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Support user mappings in get_object_address
Date: Wed, 11 Mar 2015 20:04:33 +0000
Message-ID: <E1YVmrp-00006e-1l@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Support user mappings in get_object_address

Since commit 72dd233d3ef we were trying to obtain object addressing
information in sql_drop event triggers, but that caused failures when
the drops involved user mappings.  This addition enables that to work
again.  Naturally, pg_get_object_address can work with these objects
now, too.

I toyed with the idea of removing DropUserMappingStmt as a node and
using DropStmt instead in the DropUserMappingStmt grammar production,
but that didn't go very well: for one thing the messages thrown by the
specific code are specialized (you get "server not found" if you specify
the wrong server, instead of a generic "user mapping for ... not found"
which you'd get it we were to merge this with RemoveObjects --- unless
we added even more special cases).  For another thing, it would require
to pass RoleSpec nodes through the objname/objargs representation used
by RemoveObjects, which works in isolation, but gets messy when
pg_get_object_address is involved.  So I dropped this part for now.

Reviewed by Stephen Frost.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/890192e99af5db1d15d5bb73f3f1044faa1d2758

Modified Files
--------------
src/backend/catalog/objectaddress.c          |   78 +++++++++++++++++++++++++-
src/backend/commands/event_trigger.c         |    1 +
src/include/nodes/parsenodes.h               |    1 +
src/test/regress/expected/event_trigger.out  |    9 ++-
src/test/regress/expected/object_address.out |   19 +++++--
src/test/regress/sql/event_trigger.sql       |    5 +-
src/test/regress/sql/object_address.sql      |    9 +--
7 files changed, 109 insertions(+), 13 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1YVmrp-00006e-1l@gemulon.postgresql.org>
Permalink:  ../E1YVmrp-00006e-1l@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1YVmrp-00006e-1l@gemulon.postgresql.org

 · 

reply

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: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Support user mappings in get_object_address
  In-Reply-To: <E1YVmrp-00006e-1l@gemulon.postgresql.org>
  References: <E1YVmrp-00006e-1l@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