Add ensure coordinator check to new UDF

ref_on_buraks
Burak Velioglu 2022-01-26 02:23:45 +03:00
parent cf5f554fc9
commit 7f7fd482fc
No known key found for this signature in database
GPG Key ID: F6827E620F6549C6
1 changed files with 6 additions and 0 deletions

View File

@ -168,6 +168,12 @@ worker_drop_shell_table(PG_FUNCTION_ARGS)
EnsureTableOwner(relationId); EnsureTableOwner(relationId);
if (GetLocalGroupId() == COORDINATOR_GROUP_ID)
{
ereport(ERROR, (errmsg("worker_drop_shell_table is only allowed to run"
" on worker nodes")));
}
/* first check the relation type */ /* first check the relation type */
Relation distributedRelation = relation_open(relationId, AccessShareLock); Relation distributedRelation = relation_open(relationId, AccessShareLock);
EnsureRelationKindSupported(relationId); EnsureRelationKindSupported(relationId);