The problem you are facing is actually related to how Postgres-XC / StormDB (or now Postgres-XL, where I got into this problem) handle table splitting between different datanodes.
The main problem is that the database engine cannot guarantee foreign key constraints or unique constraints. For an old article on the StormDB website about the previous version of Django and Postgres-XC / StormDB, you can do this by setting loose_constraints=true to the database. In the modern version of Django (1.6 or later), the equivalent seems to set db_constraint=False in ForeignKey according to the field docs of the Django model (which I cannot refer directly to, since I lack rep).
Another solution, if you are more concerned about availability rather than performance, is data replication, which means that you will not have a problem because all data data has the same data. I donβt know how to do it directly in Django, but you can change the table creation to use DISTRIBUTE BY REPLICATION , as described in CREATE TABLE docs.
source share