What is the default directory where postgresql will keep all databases on linux?
|
The "directory where postgresql will keep all databases" (and configuration) is called "data directory" and corresponds to what postgresql calls (a little confusingly) a "database cluster" (not related to distributed computing - it just means a group of databases and related objects managed by a postgresql server). The location of the
Besides, an instance of a running postgresql server is associated to one cluster; the location of its
Note that it is possible, though not very frequent, to run two instances of the same postgresql server (same binaries, different processes) that serve different "clusters" (data directories). Of course, each instance would listen on its own TCP/IP port. |
||||
|
At least in Gentoo Linux and Ubuntu 14.04 by default. You can find |
|||||||||||||
|
on Centos 6.5 / postgresql 9.3/ change in initial script file /etc/init.d/postgresql the value of "PGDATA=/var/lib/pgsql/data" to whatever location you want. Remember to set chmod 700 and chown postgres:postgres to the new location and you`re the boss. |
|||
|