Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working on this new ubuntu 12.04 server and I need to work on the Postgres database which is PostGIS enabled. The problem is I am not sure how to locate the database using command line.

It is already installed on the server. I just need to locate it. How do I locate it?

share|improve this question
up vote 0 down vote accepted

Look in the file /etc/postgresql/9.1/main/postgresql.conf and in the section under the title "FILE LOCATIONS". For instance:

data_directory = '/var/lib/postgresql/9.1/main'  

is what I have.

share|improve this answer
thanks found it – Sam007 Nov 21 '12 at 22:12
Alternately you can connect to it and run SHOW data_directory; – Craig Ringer Nov 22 '12 at 1:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.