Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I am using binary replication for Postgres.

Is it true that the max_connections has to be the SAME for both the master and slave in postgresql.conf?

Can they be different?

share|improve this question

migrated from stackoverflow.com Jan 31 '14 at 11:26

This question came from our site for professional and enthusiast programmers.

2 Answers 2

In general, to my knowledge, there are no known errors you will get by having purely server connection-related differences on master and slave servers. I would be rather surprised, given how streaming replication works, if you would get errors for that. There are, however, a number of reasons to try to keep your hardware and configuration as close to identical as possible. So I think a strict reading of your question is no. But there are good reasons to keep it the same.

The big reasons have to do with two things: base backups and fail over. If you are taking base backups from the slave then the base backup also includes the configuration. If you later restore it on the master, then you have configuration changes taking place solely because you restored a backup. In a disaster recovery situation, the last thing you want is to be trying to track down "what changed when we restored the backup?!"

The second thing is that this applies in more or less the same way when failing over. Because failing back is still a bit of a pain, you need to be assuming your slave can handle the master's load for a bit of time while you set things up. Keeping the configuration the same is a good way to avoid unpleasant surprises there.

share|improve this answer
It appears you're wrong because I get this error: FATAL: hot standby is not possible because max_connections = 10 is a lower setting than on the master server (its value was 1900) –  Henley Chiu Feb 11 '14 at 1:45

It a general convention to follow as the master and slave always synchronized themselves.. but you can change it depending your kernel buffer size and shared_buffers size you are allocating for each transaction in postgresql.conf file. so don't worry you can change the number of connection but for that you can get some more error.

share|improve this answer
Um, what? You can change it, but you can get "some error" if you do? Please be specific. –  Craig Ringer Jan 31 '14 at 5:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.