Fix bug for array-formatted identities of user mappings
authorAlvaro Herrera
Wed, 25 Mar 2015 17:28:34 +0000 (14:28 -0300)
committerAlvaro Herrera
Wed, 25 Mar 2015 17:28:34 +0000 (14:28 -0300)
I failed to realize that server names reported in the object args array
would get quoted, which is wrong; remove that, making sure that it's
only quoted in the string-formatted identity.

This bug was introduced by my commit cf34e373, which was backpatched,
but since object name/args arrays are new in commit a676201490c8, there
is no need to backpatch this any further.

src/backend/catalog/objectaddress.c

index 5025a4ee5bcfaa51aa8fc14c5cf6cb7d9b6495da..e82a448e6ff4f6866df074b0a4c2b84d49722383 100644 (file)
@@ -4254,7 +4254,7 @@ getObjectIdentityParts(const ObjectAddress *object,
                ReleaseSysCache(tup);
 
                if (OidIsValid(useid))
-                   usename = quote_identifier(GetUserNameFromId(useid));
+                   usename = GetUserNameFromId(useid);
                else
                    usename = "public";
 
@@ -4264,7 +4264,8 @@ getObjectIdentityParts(const ObjectAddress *object,
                    *objargs = list_make1(pstrdup(srv->servername));
                }
 
-               appendStringInfo(&buffer, "%s on server %s", usename,
+               appendStringInfo(&buffer, "%s on server %s",
+                                quote_identifier(usename),
                                 srv->servername);
                break;
            }