mirror of https://github.com/citusdata/citus.git
Cover cases: ALTER TABLE .. ADD CONSTRAINT ..
parent
2d20fa37ad
commit
e07d5c8530
|
|
@ -448,6 +448,15 @@ ErrorIfAddingPartitionTableToMetadata(Oid relationId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* SetAutoConverted is the setter function for variable autoConverted.
|
||||||
|
*/
|
||||||
|
void SetAutoConverted(bool autoConvertedValue)
|
||||||
|
{
|
||||||
|
autoConverted = autoConvertedValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ErrorIfUnsupportedCreateCitusLocalTable errors out if we cannot create the
|
* ErrorIfUnsupportedCreateCitusLocalTable errors out if we cannot create the
|
||||||
* citus local table from the relation.
|
* citus local table from the relation.
|
||||||
|
|
|
||||||
|
|
@ -1289,7 +1289,9 @@ ConvertPostgresLocalTablesToCitusLocalTables(AlterTableStmt *alterTableStatement
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
SetAutoConverted(true);
|
||||||
CreateCitusLocalTable(relationId, cascade);
|
CreateCitusLocalTable(relationId, cascade);
|
||||||
|
SetAutoConverted(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PG_CATCH();
|
PG_CATCH();
|
||||||
|
|
|
||||||
|
|
@ -533,6 +533,7 @@ extern void ExecuteForeignKeyCreateCommandList(List *ddlCommandList,
|
||||||
bool skip_validation);
|
bool skip_validation);
|
||||||
|
|
||||||
/* create_citus_local_table.c */
|
/* create_citus_local_table.c */
|
||||||
|
extern void SetAutoConverted(bool autoConvertedValue);
|
||||||
extern void CreateCitusLocalTable(Oid relationId, bool cascadeViaForeignKeys);
|
extern void CreateCitusLocalTable(Oid relationId, bool cascadeViaForeignKeys);
|
||||||
extern List * GetExplicitIndexOidList(Oid relationId);
|
extern List * GetExplicitIndexOidList(Oid relationId);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -317,7 +317,7 @@ BEGIN;
|
||||||
SET client_min_messages TO ERROR;
|
SET client_min_messages TO ERROR;
|
||||||
SELECT remove_local_tables_from_metadata();
|
SELECT remove_local_tables_from_metadata();
|
||||||
|
|
||||||
-- should not see any citus local tables
|
-- should see only local_table_3, since it's the only one that is converted by the user
|
||||||
SELECT logicalrelid::regclass::text FROM pg_dist_partition, pg_tables
|
SELECT logicalrelid::regclass::text FROM pg_dist_partition, pg_tables
|
||||||
WHERE tablename=logicalrelid::regclass::text AND
|
WHERE tablename=logicalrelid::regclass::text AND
|
||||||
schemaname='citus_local_tables_test_schema' AND
|
schemaname='citus_local_tables_test_schema' AND
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue