mirror of https://github.com/citusdata/citus.git
Advise dropping foreign key in addition to create_reference_table hint (#4590)
parent
a18d4288e9
commit
b20615cbbe
|
@ -48,7 +48,8 @@
|
|||
|
||||
#define USE_CREATE_REFERENCE_TABLE_HINT \
|
||||
"You could use SELECT create_reference_table('%s') " \
|
||||
"to replicate the referenced table to all nodes"
|
||||
"to replicate the referenced table to all nodes or " \
|
||||
"consider dropping the foreign key"
|
||||
|
||||
|
||||
typedef bool (*CheckRelationFunc)(Oid);
|
||||
|
|
|
@ -861,7 +861,7 @@ CREATE TABLE reference_table(id int, referencing_column int REFERENCES reference
|
|||
SELECT create_reference_table('reference_table');
|
||||
ERROR: referenced table "referenced_local_table" must be a distributed table or a reference table
|
||||
DETAIL: To enforce foreign keys, the referencing and referenced rows need to be stored on the same node.
|
||||
HINT: You could use SELECT create_reference_table('referenced_local_table') to replicate the referenced table to all nodes
|
||||
HINT: You could use SELECT create_reference_table('referenced_local_table') to replicate the referenced table to all nodes or consider dropping the foreign key
|
||||
-- test foreign key creation on CREATE TABLE on self referencing reference table
|
||||
CREATE TABLE self_referencing_reference_table(
|
||||
id int,
|
||||
|
@ -922,7 +922,7 @@ SELECT create_reference_table('reference_table');
|
|||
ALTER TABLE reference_table ADD CONSTRAINT fk FOREIGN KEY(referencing_column) REFERENCES referenced_local_table(id);
|
||||
ERROR: referenced table "referenced_local_table" must be a distributed table or a reference table
|
||||
DETAIL: To enforce foreign keys, the referencing and referenced rows need to be stored on the same node.
|
||||
HINT: You could use SELECT create_reference_table('referenced_local_table') to replicate the referenced table to all nodes
|
||||
HINT: You could use SELECT create_reference_table('referenced_local_table') to replicate the referenced table to all nodes or consider dropping the foreign key
|
||||
-- test foreign key creation on ALTER TABLE on self referencing reference table
|
||||
DROP TABLE self_referencing_reference_table;
|
||||
CREATE TABLE self_referencing_reference_table(
|
||||
|
|
Loading…
Reference in New Issue