fix alter_distributed_table

fix-collation-mismatch-create-dist-table
Onur Tirtir 2025-10-17 10:48:53 +03:00
parent 3341e3d9dc
commit 407a0cdadc
1 changed files with 17 additions and 0 deletions

View File

@ -2125,6 +2125,23 @@ CheckAlterDistributedTableConversionParameters(TableConversionState *con)
"distribution column is different than %s",
con->colocateWith, con->relationName)));
}
else if (con->distributionColumn &&
colocateWithPartKey->varcollid != con->distributionKey->varcollid)
{
ereport(ERROR, (errmsg("cannot colocate with %s and change distribution "
"column to %s because collation of column %s is "
"different then the distribution column of the %s",
con->colocateWith, con->distributionColumn,
con->distributionColumn, con->colocateWith)));
}
else if (!con->distributionColumn &&
colocateWithPartKey->varcollid !=
con->originalDistributionKey->varcollid)
{
ereport(ERROR, (errmsg("cannot colocate with %s because collation of its "
"distribution column is different than %s",
con->colocateWith, con->relationName)));
}
}
if (!con->suppressNoticeMessages)