From 39ed50c52f5f4e9c29b864c5a2b26c73ef2e29fa Mon Sep 17 00:00:00 2001 From: Jason Petersen Date: Thu, 20 Apr 2017 19:41:57 -0600 Subject: [PATCH] Handle removal of deleteWhatDependsOn Rather than a specific deleteWhatDependsOn, PostgreSQL 10 has a general performDeletion call whose flags allow emulation of the old function. --- .../distributed/worker/worker_merge_protocol.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/backend/distributed/worker/worker_merge_protocol.c b/src/backend/distributed/worker/worker_merge_protocol.c index dc33311e5..84cdbf9e3 100644 --- a/src/backend/distributed/worker/worker_merge_protocol.c +++ b/src/backend/distributed/worker/worker_merge_protocol.c @@ -329,7 +329,6 @@ RemoveJobSchema(StringInfo schemaName) if (OidIsValid(schemaId)) { ObjectAddress schemaObject = { 0, 0, 0 }; - bool showNotices = false; bool permissionsOK = pg_namespace_ownercheck(schemaId, GetUserId()); if (!permissionsOK) @@ -347,7 +346,16 @@ RemoveJobSchema(StringInfo schemaName) * can suppress notice messages that are typically displayed during * cascading deletes. */ - deleteWhatDependsOn(&schemaObject, showNotices); +#if (PG_VERSION_NUM >= 100000) + performDeletion(&schemaObject, DROP_CASCADE, + PERFORM_DELETION_INTERNAL | + PERFORM_DELETION_QUIETLY | + PERFORM_DELETION_SKIP_ORIGINAL | + PERFORM_DELETION_SKIP_EXTENSIONS); +#else + deleteWhatDependsOn(&schemaObject, false); +#endif + CommandCounterIncrement(); /* drop the empty schema */