PostgreSQL ----- No relations found.


本篇文章可能有錯,尚未細細研究

 

運行\d出錯:

No relations found.

\d只顯示可見的表,也就是該數據庫的schema在search_path中。

SHOW search_path;

如果沒有,設置一下:

SET search_path= tran;

其中tran是要查詢的schema。

如果\d仍然出錯,查看一下訪問權限:

\dn+

如果輸出:

                          List of schemas
  Name  |  Owner   |  Access privileges   |      Description       
--------+----------+----------------------+------------------------
 public | postgres | postgres=UC/postgres+| standard public schema
        |          | =UC/postgres         | 
 tran   | postgres |                      | 
        |          |                      |

tran行的Access privileges為空,添加權限:

grant all on SCHEMA tran to public;

運行\dn+,這時輸出:

                          List of schemas
  Name  |  Owner   |  Access privileges   |      Description       
--------+----------+----------------------+------------------------
 public | postgres | postgres=UC/postgres+| standard public schema
        |          | =UC/postgres         | 
 tran   | postgres | postgres=UC/postgres+| 
        |          | =UC/postgres         | 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM