Reputation: 627
Sorry I'm new to Postgresql (switched from MySQL due to its horrible performance) so I have a question regarding PSQL replication. Does foreign keys work in Postgresql with replication?
My guess is that syncing across multiple instances definitely has overhead and if a foreign key has to be checked before insertion, there'll be a performance penalty. Therefore, I don't know whether foreign keys work but slow or just don't work at all?
Upvotes: 0
Views: 675
Reputation: 22943
There are many different modes of replication, but foreign keys work regardless of whether you are using it or not.
A foreign key only references data within the same database however, not across servers. You might want to look at Greenplum's commercial offering if you need that sort of thing.
You will need to decide which type of replication suits your requirements though - the built-in (since 9.0) WAL-based streaming replication, or something trigger-based like Slony or Bucardo. There is also pgpool which in addition to being a connection pooler can copy statements to multiple servers.
http://wiki.postgresql.org/wiki/Replication,_Clustering,_and_Connection_Pooling
Upvotes: 1