Wednesday, April 24, 2024
 Popular · Latest · Hot · Upcoming
34
rated 0 times [  34] [ 0]  / answers: 1 / hits: 65291  / 1 Year ago, sat, november 19, 2022, 8:09:45

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?


More From » database

 Answers
1

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


[#35092] Sunday, November 20, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ormlai

Total Points: 292
Total Questions: 106
Total Answers: 115

Location: Cape Verde
Member since Fri, Sep 16, 2022
2 Years ago
ormlai questions
Wed, Sep 28, 22, 00:17, 2 Years ago
Sun, Aug 7, 22, 22:05, 2 Years ago
Wed, Jun 16, 21, 03:50, 3 Years ago
Sun, Feb 6, 22, 09:11, 2 Years ago
Mon, Jul 12, 21, 10:00, 3 Years ago
;