Postgres 数据存储位置

    PostgresQL 存储数据于data文件夹下,本人的目录为: C:\Program Files\PostgreSQL\10\data。

    

     其中,每个数据库都会在base 文件夹下有一个子文件夹,且子文件夹以数据库的oid命名。数据库的oid可以通过表pg_database获取。

Testpg=#  select oid, datname from pg_database ;
  oid   |      datname
--------+-------------------
  12938 | postgres
      1 | template1
  12937 | template0
  16393 | pem
 404609 | Testpg100
 405086 | postgis_25_sample
 407547 | Testpg1
 415074 | Testpg
(8 行记录)

     数据库Testpg的 oid 为 415074,即数据库Testpg中的数据都存储在415074文件夹下。

     

猜你喜欢

转载自blog.csdn.net/liyazhen2011/article/details/88993728