we should not log error in preprocess if attached partition is missing. (#6131)

users/saawasek/non_blocking_split_integrated^2
aykut-bozkurt 2022-08-04 15:49:14 +03:00 committed by GitHub
parent a1c630a16e
commit b67abdd28c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -439,9 +439,18 @@ PreprocessAlterTableStmtAttachPartition(AlterTableStmt *alterTableStatement,
Oid parentRelationId = AlterTableLookupRelation(alterTableStatement,
lockmode);
PartitionCmd *partitionCommand = (PartitionCmd *) alterTableCommand->def;
bool partitionMissingOk = false;
bool partitionMissingOk = true;
Oid partitionRelationId = RangeVarGetRelid(partitionCommand->name, lockmode,
partitionMissingOk);
if (!OidIsValid(partitionRelationId))
{
/*
* We can stop propagation here instead of logging error. Pg will complain
* in standard_utility, so we are safe to stop here. We pass missing_ok
* as true to not diverge from pg output.
*/
return NIL;
}
if (!IsCitusTable(parentRelationId))
{