#2694 - Postgres DDL - For Postgres table partitioning, remove the "suppressPrimaryKeyOnPartition" mode

This commit is contained in:
Rob Bygrave
2022-05-16 21:48:19 +12:00
parent cc7f3d49a4
commit ceac2d12b1
3 changed files with 1 additions and 12 deletions
@@ -216,9 +216,7 @@ public class BaseTableDdl implements TableDdl {
writeCompoundUniqueConstraints(apply, createTable);
if (!pk.isEmpty()) {
// defined on the columns
if (partitionMode == null || !platformDdl.suppressPrimaryKeyOnPartition()) {
writePrimaryKeyConstraint(apply, createTable.getPkName(), toColumnNames(pk));
}
writePrimaryKeyConstraint(apply, createTable.getPkName(), toColumnNames(pk));
}
if (platformDdl.isInlineForeignKeys()) {
writeInlineForeignKeys(apply, createTable);
@@ -732,10 +732,6 @@ public class PlatformDdl {
return createTable;
}
public boolean suppressPrimaryKeyOnPartition() {
return false;
}
public void addTablePartition(DdlBuffer apply, String partitionMode, String partitionColumn) {
// only supported by postgres initially
}
@@ -30,11 +30,6 @@ public class PostgresDdl extends PlatformDdl {
return "set lock_timeout = " + (lockTimeoutSeconds * 1000);
}
@Override
public boolean suppressPrimaryKeyOnPartition() {
return true;
}
@Override
protected String convertArrayType(String logicalArrayType) {
return NativeDbArray.logicalToNative(logicalArrayType);