Apparently, I should put postgresql.conf in a separate directory, according to this:

# Note that recovery.conf must be in $PGDATA directory.
# It should NOT be located in the same directory as postgresql.conf

Is there any particular reason? I've seen systems where the two seem to work fine when they're both in the $PGDATA directory.


This comment is meant to users who have postgresql.conf outside of $PGDATA. For instance Debian-based packages for PostgreSQL install the data directory inside /var/lib/postgresql and the configuration files inside /etc/postgresql/.

With that layout, some users could think of putting recovery.conf in the same directory than postgresql.conf, just because it's a config file too. But it's a mistake, it would be ignored.

To be less ambiguous, the second sentence could be:

# It should NOT be located in the same directory as postgresql.conf,
# unless that directory happens to be $PGDATA
  • YES! It certainly should say that, especially since the default configuration has postgresql.conf in $PGDATA – medley56 Aug 23 '18 at 19:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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