citus_docs
citus_docs copied to clipboard
Tip for distributing tables with foreign keys
Communication goals (e.g. detailed howto vs orientation)
Citus does not support adding foreign keys between local and distributed tables. It does support distributing the target table for an existing foreign key. It does not allow distributing the source table for an existing foreign key. Thus the easiest way to avoid getting tangled up in dependencies is to distribute all tables first, and add foreign keys later.
Good locations for content in docs structure
- Update http://docs.citusdata.com/en/v7.5/develop/reference_ddl.html#adding-removing-constraints
- See whether the note needs updating in http://docs.citusdata.com/en/v7.5/develop/reference_ddl.html#distributing-coordinator-data
Question for SE: have we considered marking the FKs as "NOT VALID" prior to distribution, and running "VALIDATE CONSTRAINT" afterward? That's a pg feature made available in 8.1