object description for FDW user mappings

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: object description for FDW user mappings
Date: 2015-03-05 15:46:17
Message-ID: 20150305154617.GT3291@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

When commit cae565e503 introduced FDW user mappings, it used this in
getObjectDescription for them:

appendStringInfo(&buffer, _("user mapping for %s"), usename);

This was later mostly copied (by yours truly) as object identity by
commit f8348ea32e wherein I used this:
appendStringInfo(&buffer, "%s", usename);

As it turns out, this is wrong, because the pg_user_mapping catalog has
a two-column "primary key" which is user OID and server OID. Therefore
it seems to me that the correct object description and identity must
include both username and server name. I propose we change the above to
this:

appendStringInfo(&buffer, _("user mapping for %s in server %s"), usename,
srv->servername);

I propose to apply the (appropriately rebased) attached patch to all
back branches. Note in particular the wording changes in some error
messages in the foreign_data test.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
0001-fix-user-mapping-object-description-identity.patch text/x-diff 6.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-03-05 15:50:09 Re: Combining Aggregates
Previous Message Robert Haas 2015-03-05 15:42:52 Re: Strange assertion using VACOPT_FREEZE in vacuum.c