Postgresql service using a different data directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Helpful Fedora users,

Summary:
I would like to have Postgres (as a service) use a different data
directory instead of the default /var/lib/pgsql/data, but I am not sure
how to do this.

Problem:
Is there a way to have Postgres use a different data directory short of
editing /etc/rc.d/init.d/postgresql and changing the default setting of
PGDATA? I noticed that /etc/rc.d/init.c/postgresql looks to files in
/etc/sysconfig/pgsql, but I don't have any files there to guide
editing/additions and I cannot find documentation on the subject. However,
I presume adding a file to /etc/sysconfig/pgsql is the best way to go. Can
someone confirm and explain this? (E.g. would I also need to specify
PGLOG? Is it important to back up the log?)

Background:
I would like Postgres to use /data/pgsql/data as the data directory
instead of /var/lib/pgsql/data. /data is a RAID array for me and is also
easier to use than selectively backing up parts of /var. The Postgres
documentation does not cover this aspect of the configuration as it is
OS-specific configuration of services. Searching the internet has not been
helpful either. I already reconstructed my database in my desired location
and can access it when explicitly running postgres and specifying the data
directory. However, running postgres as a service defaults to using
/var/lib/pgsql/data, which is not what I want.

I would really appreciate any help and advice on this problem.

Aubrey


      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux