1

I am reading this thread and the manual of PostgreSQL 9.4. I run

ps auxw |  grep postgres | grep -- -D

but get

postgres 17340  0.0  0.5 226700 21756 ?        S    09:50   0:00 /usr/lib/postgresql/9.4/bin/postgres -D /var/lib/postgresql/9.4/main -c config_file=/etc/postgresql/9.4/main/postgresql.conf

but the default installation location should be /usr/local/pgsql/ according to the manual at file:///usr/share/doc/postgresql-doc-9.4/html/install-short.html.

It may be possible that the database was initdb in the /usr/lib/ directory.

How can you change the installation location of PostgreSQL?

Community
  • 1
  • 1
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697

1 Answers1

2

The thread you're reading says that the installation directory is /usr/local/pgsql when you install from source, so I suppose this is what you do as well. To change the directory that make install uses for installation, you need to specify the --prefix argument to configure:

./configure --prefix=/path/to/install
make
sudo make install

PS: in case you don't install from source, refer to the documentation which comes with your package manager.

Dmitry Grigoryev
  • 3,156
  • 1
  • 25
  • 53