P
P
partisan422019-05-24 12:53:45
PostgreSQL
partisan42, 2019-05-24 12:53:45

How to see the ratio of directories and databases in PgSQL?

Good day.
I have CentOS with PostgreSQL.
As usual in the /var/lib/pgsql directory, I see a bunch of directories with chaotic names made of numbers. Also by doing psql -l I can see the list of databases. Can I somehow see which directory belongs to which database? What would physically bekapit certain bases? And in general, in order to better understand what is there and how it works?
PS. Is there any login in the names of the directories? Or is it pure random?
Thank you very much in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2019-05-24
@partisan42

physically back up certain databases

You can't.
Well, in the sense you can copy individual files. But to restore later - no. Never.
You can only backup the entire datadir, with all the symlinks. By correctly explaining to the database that you are backing it up and observing the expectations of the base according to the method of its backup so that you can then recover from it.
And the database directories are named identically to the oid field in pg_database

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question