Я запутался в том, где искать местоположения базы данных в PostgreSQL.
Я знаю команду SHOW data_directory
.В частности, я настроил кластер в расположении data/postgres
.Когда я подключаюсь к этому кластеру и создаю в нем базу данных, SHOW data_directory
возвращает следующий результат:
yql@ubuntu1804:/data/postgresdb$ sudo -u postgres psql -p 5433
Password:
psql (10.6 (Ubuntu 10.6-0ubuntu0.18.04.1))
Type "help" for help.
postgres=# \c sample
You are now connected to database "sample" as user "postgres".
sample=# show data_directory;
data_directory
----------------
/postgresdb
(1 row)
При использовании \dt
перечисляются следующие результаты, поэтому база данных не должна быть пустой:
List of relations
Schema | Name | Type | Owner
--------+--------------------------+-------+----------
citydb | address | table | postgres
citydb | address_to_bridge | table | postgres
citydb | address_to_building | table | postgres
citydb | ade | table | postgres
citydb | aggregation_info | table | postgres
citydb | appear_to_surface_data | table | postgres
citydb | appearance | table | postgres
citydb | breakline_relief | table | postgres
citydb | bridge | table | postgres
citydb | bridge_constr_element | table | postgres
citydb | bridge_furniture | table | postgres
citydb | bridge_installation | table | postgres
citydb | bridge_open_to_them_srf | table | postgres
citydb | bridge_opening | table | postgres
citydb | bridge_room | table | postgres
citydb | bridge_thematic_surface | table | postgres
citydb | building | table | postgres
citydb | building_furniture | table | postgres
citydb | building_installation | table | postgres
citydb | city_furniture | table | postgres
citydb | citymodel | table | postgres
citydb | cityobject | table | postgres
citydb | cityobject_genericattrib | table | postgres
citydb | cityobject_member | table | postgres
citydb | cityobjectgroup | table | postgres
citydb | database_srs | table | postgres
citydb | external_reference | table | postgres
citydb | generalization | table | postgres
citydb | generic_cityobject | table | postgres
citydb | grid_coverage | table | postgres
citydb | group_to_cityobject | table | postgres
citydb | implicit_geometry | table | postgres
citydb | index_table | table | postgres
citydb | land_use | table | postgres
citydb | masspoint_relief | table | postgres
citydb | objectclass | table | postgres
citydb | opening | table | postgres
Однако каталог /data/postgresdb
пуст.Как это могло быть?Если да, где хранятся все эти таблицы?
Спасибо!