0

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?

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.