Skip to content

Commit 33c5d3b

Browse files
committed
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
1 parent 753051c commit 33c5d3b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/backend/commands/foreigncmds.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,8 +1205,12 @@ CreateUserMapping(CreateUserMappingStmt *stmt)
12051205
recordDependencyOnOwner(UserMappingRelationId, umId, useId);
12061206
}
12071207

1208-
/* dependency on extension */
1209-
recordDependencyOnCurrentExtension(&myself, false);
1208+
/*
1209+
* Perhaps someday there should be a recordDependencyOnCurrentExtension
1210+
* call here; but since roles aren't members of extensions, it seems like
1211+
* user mappings shouldn't be either. Note that the grammar and pg_dump
1212+
* would need to be extended too if we change this.
1213+
*/
12101214

12111215
/* Post creation hook for new user mapping */
12121216
InvokeObjectPostCreateHook(UserMappingRelationId, umId, 0);

0 commit comments

Comments
 (0)