【问题标题】:Did not find any relation named table_name in Postgres在 Postgres 中没有找到任何名为 table_name 的关系
【发布时间】:2022-02-21 23:14:27
【问题描述】:

当我试图在我的架构中列出有关表 boarding_passes 的信息时,我收到一个错误:

demo=# \d boarding_passes
Did not find any relation named "boarding_passes".

这是我的架构中所有关系的列表:

 demo=# \dt bookings.*
             List of relations
  Schema  |      Name       | Type  | Owner
----------+-----------------+-------+-------
 bookings | aircrafts       | table | dba
 bookings | airports        | table | dba
 bookings | boarding_passes | table | dba
 bookings | bookings        | table | dba
 bookings | flights         | table | dba
 bookings | seats           | table | dba
 bookings | ticket_flights  | table | dba
 bookings | tickets         | table | dba
(8 rows)

【问题讨论】:

    标签: postgresql unix centos psql


    【解决方案1】:

    由于bookings显然不在你的search_path上,你需要使用

    \d bookings.boarding_passes
    

    【讨论】:

    • 是的,谢谢,我刚刚设置了search_path TO bookings,以避免以后输入架构名称
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-07-25
    • 2020-04-15
    • 1970-01-01
    • 2013-07-08
    • 2012-09-22
    • 2011-01-03
    • 2012-01-13
    相关资源
    最近更新 更多