Locating the database server files
Database server files are initially stored in a location referred to as the data directory. Additional data files may also be stored in tablespaces, if any exist.
In this recipe, you will learn how to find the location of these directories on a given database server.
Getting ready
You'll need to get operating system access to the database system, which is what we call the platform on which the database runs.
How to do it...
The following are the system default data
directory locations:
- Debian or Ubuntu systems:
/var/lib/postgresql/MAJOR_RELEASE/main
- Red Hat RHEL, CentOS, and Fedora:
/var/lib/pgsql/data/
- Windows:
C:\Program Files\PostgreSQL\MAJOR_RELEASE\data
MAJOR_RELEASE
is composed of just one number (for release 10 and above) or by two (for releases up to 9.6).
On Debian or Ubuntu systems, the configuration files are located in /etc/postgresql/MAJOR_RELEASE/main/
, where main
is just the name of a database server. Other names are also possible. For the sake of...