#include "catalog/pg_ts_config.h"
#include "catalog/pg_ts_dict.h"
#include "catalog/pg_type.h"
+#include "catalog/pg_user_mapping.h"
#include "commands/alter.h"
#include "commands/dbcommands.h"
#include "commands/collationcmds.h"
*/
break;
+ case UserMappingRelationId:
+ /* ditto */
+ break;
+
case ForeignServerRelationId:
AlterForeignServerOwner_oid(sdepForm->objid, newrole);
break;
DROP FOREIGN TABLE IF EXISTS no_table;
NOTICE: foreign table "no_table" does not exist, skipping
DROP FOREIGN TABLE foreign_schema.foreign_table_1;
+-- REASSIGN OWNED/DROP OWNED of foreign objects
+REASSIGN OWNED BY regress_test_role TO regress_test_role2;
+DROP OWNED BY regress_test_role2;
+ERROR: cannot drop desired object(s) because other objects depend on them
+DETAIL: user mapping for regress_test_role on server s5 depends on server s5
+HINT: Use DROP ... CASCADE to drop the dependent objects too.
+DROP OWNED BY regress_test_role2 CASCADE;
+NOTICE: drop cascades to user mapping for regress_test_role on server s5
-- Cleanup
DROP SCHEMA foreign_schema CASCADE;
DROP ROLE regress_test_role; -- ERROR
DETAIL: privileges for server s4
privileges for foreign-data wrapper foo
owner of user mapping for regress_test_role on server s6
-owner of user mapping for regress_test_role on server s5
-owner of server s5
-owner of server t2
-DROP SERVER s5 CASCADE;
-NOTICE: drop cascades to user mapping for regress_test_role on server s5
DROP SERVER t1 CASCADE;
NOTICE: drop cascades to user mapping for public on server t1
-DROP SERVER t2;
DROP USER MAPPING FOR regress_test_role SERVER s6;
-- This test causes some order dependent cascade detail output,
-- so switch to terse mode for it.
DROP FOREIGN TABLE IF EXISTS no_table;
DROP FOREIGN TABLE foreign_schema.foreign_table_1;
+-- REASSIGN OWNED/DROP OWNED of foreign objects
+REASSIGN OWNED BY regress_test_role TO regress_test_role2;
+DROP OWNED BY regress_test_role2;
+DROP OWNED BY regress_test_role2 CASCADE;
+
-- Cleanup
DROP SCHEMA foreign_schema CASCADE;
DROP ROLE regress_test_role; -- ERROR
-DROP SERVER s5 CASCADE;
DROP SERVER t1 CASCADE;
-DROP SERVER t2;
DROP USER MAPPING FOR regress_test_role SERVER s6;
-- This test causes some order dependent cascade detail output,
-- so switch to terse mode for it.