summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-08-07 16:32:50 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2018-08-07 16:33:12 -0400
commit33c5d3bf85d7ae01ee66bb3a4d77abde85c0f8bf (patch)
treef0d3e532dd720c6da2bf08bb709cc62eb44851e1
parent753051cc721e9123e817b929b257e53a9b97a502 (diff)
Don't record FDW user mappings as members of extensions.
CreateUserMapping has a recordDependencyOnCurrentExtension call that's been there since extensions were introduced (very possibly my fault). However, there's no support anywhere else for user mappings as members of extensions, nor are they listed as a possible member object type in the documentation. Nor does it really seem like a good idea for user mappings to belong to extensions when roles don't. Hence, remove the bogus call. (As we saw in bug #15310, the lack of any pg_dump support for this case ensures that any such membership record would silently disappear during pg_upgrade. So there's probably no need for us to do anything else about cleaning up after this mistake.) Discussion: https://postgr.es/m/27952.1533667213@sss.pgh.pa.us
-rw-r--r--src/backend/commands/foreigncmds.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/commands/foreigncmds.c b/src/backend/commands/foreigncmds.c
index 09fada7ace5..ea6fec1d235 100644
--- a/src/backend/commands/foreigncmds.c
+++ b/src/backend/commands/foreigncmds.c
@@ -1205,8 +1205,12 @@ CreateUserMapping(CreateUserMappingStmt *stmt)
recordDependencyOnOwner(UserMappingRelationId, umId, useId);
}
- /* dependency on extension */
- recordDependencyOnCurrentExtension(&myself, false);
+ /*
+ * Perhaps someday there should be a recordDependencyOnCurrentExtension
+ * call here; but since roles aren't members of extensions, it seems like
+ * user mappings shouldn't be either. Note that the grammar and pg_dump
+ * would need to be extended too if we change this.
+ */
/* Post creation hook for new user mapping */
InvokeObjectPostCreateHook(UserMappingRelationId, umId, 0);