Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where Postgres database files are saved in ubuntu?

Tags:

How can I find where Postgres 8.x database files are saved in Ubuntu 10.04 file system?

like image 231
Mithun Sreedharan Avatar asked Aug 12 '10 11:08

Mithun Sreedharan


People also ask

Where are Postgres database files stored Ubuntu?

You can now locate the Postgres Database files by navigating the directory that was displayed. However, the PostgreSQL configuration directory in Ubuntu is located in /etc/postgresql/10/main .

Where is postgresql database saved?

All the data needed for a database cluster is stored within the cluster's data directory, commonly referred to as PGDATA (after the name of the environment variable that can be used to define it). A common location for PGDATA is /var/lib/pgsql/data.

Where is Postgres data stored in Linux?

By default, the data_directory is set to /var/lib/postgresql/10/main in the /etc/postgresql/10/main/postgresql. conf file.


1 Answers

In the postgres prompt, just execute this query:

SHOW data_directory; 

Check also the Ubuntu manual: https://help.ubuntu.com/10.04/serverguide/C/postgresql.html

like image 91
Frank Heikens Avatar answered Sep 17 '22 01:09

Frank Heikens