Handle removal of deleteWhatDependsOn

Rather than a specific deleteWhatDependsOn, PostgreSQL 10 has a general
performDeletion call whose flags allow emulation of the old function.
pull/1439/head
Jason Petersen 2017-04-20 19:41:57 -06:00
parent 90bf243904
commit 39ed50c52f
No known key found for this signature in database
GPG Key ID: 9F1D3510D110ABA9
1 changed files with 10 additions and 2 deletions

View File

@ -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 */