我在通过 psql 连接到数据库时遇到问题。我收到此错误:
postgres@server:/var/lib/pgsql # psql -d aisgdmp2
psql: error: FATAL: database "aisgdmp2" does not exist
DETAIL: The database subdirectory "pg_tblspc/16385/PG_13_202007201/16386" is missing.
postgres@server:/var/lib/pgsql #
但是当我连接到 posgtres 并列出数据库时,aisgdmp2 数据库存在......
postgres@server:/var/lib/pgsql # psql
psql (13.5)
postgres=# \l
DB list
Name | Owner | Code | Collation | CType | Privileges
-----------+----------+----------+-------------+-------------+-----------------------
aisgdmp2 | aisg | UTF8 | cs_CZ.UTF-8 | cs_CZ.UTF-8 | =Tc/aisg +
| | | | | aisg=CTc/aisg
postgres | postgres | UTF8 | cs_CZ.UTF-8 | cs_CZ.UTF-8 |
template0 | postgres | UTF8 | cs_CZ.UTF-8 | cs_CZ.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | cs_CZ.UTF-8 | cs_CZ.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(4 rows)
postgres=#
知道问题出在哪里吗?该数据库过去一直在运行,但过去两个月一直处于停机状态。