CDB_Federated_Server_Unregister: Drop owned in cascade

Since now views might be owned by other roles, we need to drop them
in cascade to force deletion
This commit is contained in:
Raúl Marín 2019-11-14 14:07:41 +01:00
parent 64e185b841
commit 1b86517007

View File

@ -301,7 +301,7 @@ BEGIN
SET client_min_messages = ERROR;
BEGIN
EXECUTE FORMAT ('DROP USER MAPPING FOR PUBLIC SERVER %I', server_internal);
EXECUTE FORMAT ('DROP OWNED BY %I', role_name);
EXECUTE FORMAT ('DROP OWNED BY %I CASCADE', role_name);
EXECUTE FORMAT ('DROP ROLE %I', role_name);
EXCEPTION WHEN OTHERS THEN
RAISE EXCEPTION 'Not enough permissions to drop the server "%"', server;