diff --git a/src/backend/distributed/utils/resource_lock.c b/src/backend/distributed/utils/resource_lock.c index bad6218c1..f0cbfc522 100644 --- a/src/backend/distributed/utils/resource_lock.c +++ b/src/backend/distributed/utils/resource_lock.c @@ -1129,7 +1129,7 @@ AcquireDistributedLockOnRelations_Internal(List *relationIdList, LOCKMODE lockMo LOCK_RELATION_IF_EXISTS; appendStringInfo(lockRelationCommand, lockCommand, quote_literal_cstr(qualifiedRelationName), - lockModeCString); + quote_literal_cstr(lockModeCString)); /* preemptive permission check so a worker connection is not */ /* established if the user is not allowed to acquire the lock */ diff --git a/src/include/distributed/resource_lock.h b/src/include/distributed/resource_lock.h index 5bf2d1329..ee70d6a3c 100644 --- a/src/include/distributed/resource_lock.h +++ b/src/include/distributed/resource_lock.h @@ -117,9 +117,9 @@ typedef enum CitusOperations #define DIST_LOCK_NOWAIT 1 << 2 #define LOCK_RELATION_IF_EXISTS \ - "SELECT pg_catalog.lock_relation_if_exists(%s, quote_literal_cstr(%s));" + "SELECT pg_catalog.lock_relation_if_exists(%s, %s);" #define LOCK_RELATION_IF_EXISTS_NOWAIT \ - "SELECT pg_catalog.lock_relation_if_exists(%s, quote_literal_cstr(%s), nowait => true);" + "SELECT pg_catalog.lock_relation_if_exists(%s, %s, nowait => true);" /* Lock shard/relation metadata for safe modifications */ extern void LockShardDistributionMetadata(int64 shardId, LOCKMODE lockMode);