mirror of https://github.com/citusdata/citus.git
Address review
parent
04511cc5e0
commit
cc6c0cf7eb
|
@ -156,9 +156,6 @@ worker_drop_distributed_table_only(PG_FUNCTION_ARGS)
|
||||||
text *relationName = PG_GETARG_TEXT_P(0);
|
text *relationName = PG_GETARG_TEXT_P(0);
|
||||||
Oid relationId = ResolveRelationId(relationName, true);
|
Oid relationId = ResolveRelationId(relationName, true);
|
||||||
|
|
||||||
ObjectAddress distributedTableObject = { InvalidOid, InvalidOid, 0 };
|
|
||||||
char relationKind = '\0';
|
|
||||||
|
|
||||||
if (!OidIsValid(relationId))
|
if (!OidIsValid(relationId))
|
||||||
{
|
{
|
||||||
ereport(NOTICE, (errmsg("relation %s does not exist, skipping",
|
ereport(NOTICE, (errmsg("relation %s does not exist, skipping",
|
||||||
|
@ -170,13 +167,14 @@ worker_drop_distributed_table_only(PG_FUNCTION_ARGS)
|
||||||
|
|
||||||
/* first check the relation type */
|
/* first check the relation type */
|
||||||
Relation distributedRelation = relation_open(relationId, AccessShareLock);
|
Relation distributedRelation = relation_open(relationId, AccessShareLock);
|
||||||
relationKind = distributedRelation->rd_rel->relkind;
|
char relationKind = distributedRelation->rd_rel->relkind;
|
||||||
EnsureRelationKindSupported(relationId);
|
EnsureRelationKindSupported(relationId);
|
||||||
|
|
||||||
/* close the relation since we do not need anymore */
|
/* close the relation since we do not need anymore */
|
||||||
relation_close(distributedRelation, AccessShareLock);
|
relation_close(distributedRelation, AccessShareLock);
|
||||||
|
|
||||||
/* prepare distributedTableObject for dropping the table */
|
/* prepare distributedTableObject for dropping the table */
|
||||||
|
ObjectAddress distributedTableObject = { InvalidOid, InvalidOid, 0 };
|
||||||
distributedTableObject.classId = RelationRelationId;
|
distributedTableObject.classId = RelationRelationId;
|
||||||
distributedTableObject.objectId = relationId;
|
distributedTableObject.objectId = relationId;
|
||||||
distributedTableObject.objectSubId = 0;
|
distributedTableObject.objectSubId = 0;
|
||||||
|
|
Loading…
Reference in New Issue