首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >可以在phpPgAdmin中看到表,但不能在psql (或任何其他方法)中看到

可以在phpPgAdmin中看到表,但不能在psql (或任何其他方法)中看到
EN

Stack Overflow用户
提问于 2014-07-11 13:06:23
回答 1查看 846关注 0票数 0

我最近在我的Mac上安装了postgres,并从我们的公共网站上加载了一个转储,我试图在本地复制它。pg_restore看起来很成功,我可以在phpPgAdmin中看到我的所有表和用户权限。它们看起来都很正常,我可以浏览数据。但是,当我通过psql访问数据库时,没有找到任何关系。类似地,我有访问此数据库的python脚本,而且它们也找不到任何表。

我真不知该怎么办才好。

下面是我所做的一些psql命令:

代码语言:javascript
复制
> 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时是否会出现新的数据库。

对于下一步检查什么有什么建议吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-07-11 13:11:37

请求mgd模式中的关系列表

代码语言:javascript
复制
\d mgd.*

使mgd模式成为搜索路径开头的默认位置

代码语言:javascript
复制
set search_path to mgd, "$user", public;
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24698498

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档