Database Reference
In-Depth Information
Here, R.r is the major and minor release number of the database server software, such as
9.0. The configuration files are located in:
F /etc/postgresql/R.rNn/main/
In both cases, main is just the name of a database server. Other names are also possible. For
the sake of simplicity, the rest of the topic assumes that you have only a single installation.
On Red Hat RHEL, CentOS, or Fedora the default data directory location is as follows:
F /var/lib/pgsql/data/
This also contains, by default, the configuration files ( *.conf ).
Again, data is just the default location. You can create additional data directories by using
the initdb utility.
On Windows and OS X, the default data directory location is as follows:
F C:\Program Files\PostgreSQL\R.r\data
How it works...
Even though the Debian/Ubuntu and Red Hat file layouts are different, they both follow
the Linux Filesystem Hierarchy Standard (FHS), so neither layout is wrong.
The Red Hat layout is simpler and easier to understand. The Debian/Ubuntu layout is more
complex, though it has different and more adventurous goals. The Debian/Ubuntu layout is
similar to the Optimal Flexible Architecture (OFA) of other database systems. The goals are
to provide a file layout that will allow you to have multiple PostgreSQL database servers on
one system, and to allow many versions of the software to exist at once in the filesystem.
The layout for the Windows and OS X installers is different again. Multiple database clusters
are possible, but are also more complex than on Debian/Ubuntu.
I recommend that you follow the Debian/Ubuntu layout, on whichever platform you are using.
It doesn't really have a name, so I call it the PostgreSQL Flexible Architecture (PFA). If you
do this, you'll need to lay things out yourself, but it does pay off in the long run. PFA uses the
following environment variables to name parts of the file layout:
F export PGROOT=/var/lib/pgsql/
F export PGRELEASE=9.0
F export PGSERVERNAME=mamba
F export PGDATADIR=$PGROOT/$PGRELEASE/$PGSERVERNAME
F example, PGDATADIR is /var/lib/pgsql/9.0/mamba
 
Search WWH ::




Custom Search