Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 353687 - dev-db/postgresql-server: put *.conf files into /etc/postgresql-${SLOT} directory
Summary: dev-db/postgresql-server: put *.conf files into /etc/postgresql-${SLOT} direc...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: PgSQL Bugs
Depends on:
Reported: 2011-02-04 13:44 UTC by Marc Schiffbauer
Modified: 2011-03-21 04:25 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Marc Schiffbauer gentoo-dev 2011-02-04 13:44:57 UTC
Please consider moving the three main configuration files 
 from /var/lib/postgresql/${SLOT}/data 
 to /etc/postgresql-${SLOT}

(pg_hba.conf, pg_ident.conf and postgresql.conf)

and symlink them to /var/lib/postgresql/${SLOT}/data instead.

This would have some advantages:
 - Backup: Backing up postgres config is easier because everybody just puts /etc into backup.
   (Remind that the data directory under /var/lib/postgresql normally should be excluded from backup explicitly and DB dumps should be backed up instead)

- Users can easly find config files under /etc
Comment 1 Aaron W. Swenson gentoo-dev 2011-02-08 18:43:48 UTC
This can be resolved. It cannot be resolved in one commit. It will take some time for the fix to really come about.

A symlink will not be used as the solution.
Comment 2 John Feuerstein 2011-02-08 18:49:25 UTC
Adding some info to the discussion, see also bug 175195 from 2007.

Placing configuration files in /var/lib breaks the FHS[1].
People putting /etc under version control are unable to track config changes.
People creating backups of /etc to secure host configuration are doomed.

Upstream[2] supports moving config files out of the data storage. This can be done with runtime configuration, or alternatively, as Marc suggested, using symlinks.



"Users must never need to modify files in /var/lib to configure a package's


"If you wish to keep the configuration files elsewhere than the data directory,
the postgres -D command-line option or PGDATA environment variable must point
to the directory containing the configuration files, and the data_directory
parameter must be set in postgresql.conf (or on the command line) to show where
the data directory is actually located. Notice that data_directory overrides -D
and PGDATA for the location of the data directory, but not for the location of
the configuration files."
Comment 3 Aaron W. Swenson gentoo-dev 2011-03-21 04:25:16 UTC

  21 Mar 2011; Aaron W. Swenson <>
  +postgresql-server-8.2.20-r1.ebuild, +postgresql-server-8.3.14-r1.ebuild,
  +postgresql-server-8.4.7-r1.ebuild, +postgresql-server-9.0.3-r1.ebuild:
  Fixes bugs 274836, 302384, 323683, 325709, 347005, 347223, 353687 and