我最近在我的Mac上安装了postgres,并从我们的公共网站上加载了一个转储,我试图在本地复制它。pg_restore看起来很成功,我可以在phpPgAdmin中看到我的所有表和用户权限。它们看起来都很正常,我可以浏览数据。但是,当我通过psql访问数据库时,没有找到任何关系。类似地,我有访问此数据库的python脚本,而且它们也找不到任何表。
我真不知该怎么办才好。
下面是我所做的一些psql命令:
> psql -U mgd_dbo pub_mgd
psql (9.3.4)
Type "help" for help.
pub_mgd=# \d
No relations found.
pub_mgd=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
------------+------------+----------+------------------+-------+-------------------------
postgres | postgres | UTF8 | C | C | =CTc/postgres +
| | | | | postgres=CTc/postgres +
| | | | | mgd_dbo=CTc/postgres +
| | | | | mgd_public=CTc/postgres
pub_fe | postgres | LATIN9 | en_US.ISO8859-15 | C | =CTc/postgres +
| | | | | postgres=CTc/postgres +
| | | | | mgd_dbo=CTc/postgres +
| | | | | mgd_public=CTc/postgres
pub_mgd | postgres | LATIN9 | en_US.ISO8859-15 | C | =CTc/postgres +
| | | | | postgres=CTc/postgres +
| | | | | mgd_dbo=CTc/postgres +
| | | | | mgd_public=CTc/postgres
template0 | postgres | UTF8 | C | C | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | C | C | =c/postgres +
| | | | | postgres=CTc/postgres
(5 rows)
pub_mgd=# \dn+
List of schemas
Name | Owner | Access privileges | Description
--------+----------+----------------------+------------------------
mgd | mgd_dbo | mgd_dbo=UC/mgd_dbo +|
| | mgd_public=U/mgd_dbo |
public | postgres | postgres=UC/postgres+| standard public schema
| | =UC/postgres |
(2 rows)pub_mgd是我加载的数据库。mgd_public和mgd_dbo是脚本使用的两个不同的用户(mgd_public是只读用户)。我已经尝试过这两个用户,甚至作为postgres用户。然而,结果是一样的,没有关系。
我甚至试图查看phpPgAdmin是否碰到了不同的postgres服务器,因此我通过它添加了一个新的数据库,并验证了当我在psql中运行\l时是否会出现新的数据库。
对于下一步检查什么有什么建议吗?
发布于 2014-07-11 13:11:37
请求mgd模式中的关系列表
\d mgd.*使mgd模式成为搜索路径开头的默认位置
set search_path to mgd, "$user", public;https://stackoverflow.com/questions/24698498
复制相似问题