Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I installed and created a Postgresql database on ubuntu. I then created the database using the following command:

sudo su postgres createdb mydatabase

However, I can't figure out where the database was initialized. I would like to be able to edit the hba.conf file and postgresl.conf files.

When I view the database using pgadmin I see the following information:

CREATE DATABASE mydatabase
  WITH OWNER = postgres
       ENCODING = 'UTF8'
       TABLESPACE = pg_default
       LC_COLLATE = 'en_US.UTF-8'
       LC_CTYPE = 'en_US.UTF-8'
       CONNECTION LIMIT = -1;

Any thoughts on how I can find the database cluster location?

share|improve this question
add comment

1 Answer 1

up vote 6 down vote accepted

The postgres.conf file is located here: etc/postgresql/9.1/main/postgres.conf. In postgres.conf can see a line stating data_directory=<path>

This is the directory where your database files are stored

Alternatively when you are connected to database use

SHOW data_directory

or

pg_lsclusters

to show the directory where your data is stored.

Hope this helps

share|improve this answer
add comment

Your Answer

 
discard

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.