Merge pull request #2929 from citusdata/fix_pg12_distobject

get_catalog_object_by_oid requires an extra parameter in pg12
pull/2911/head
Philip Dubé 2019-09-05 16:46:04 +00:00 committed by GitHub
commit 60dc42a3ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -94,7 +94,12 @@ ObjectExists(const ObjectAddress *address)
HeapTuple objtup; HeapTuple objtup;
Relation catalog = heap_open(address->classId, AccessShareLock); Relation catalog = heap_open(address->classId, AccessShareLock);
#if PG_VERSION_NUM >= 120000
objtup = get_catalog_object_by_oid(catalog, get_object_attnum_oid(
address->classId), address->objectId);
#else
objtup = get_catalog_object_by_oid(catalog, address->objectId); objtup = get_catalog_object_by_oid(catalog, address->objectId);
#endif
heap_close(catalog, AccessShareLock); heap_close(catalog, AccessShareLock);
if (objtup != NULL) if (objtup != NULL)
{ {