当前位置:网站首页>PostgreSQL executes the query statement with an error: relation "table_xxx" does not exist
PostgreSQL executes the query statement with an error: relation "table_xxx" does not exist
2022-07-21 21:19:00 【sunny05296】
New schema After creating the table , perform select * from table_xxx; Query error ERROR: relation "table_xxx" does not exist
testdb01=> select * from table_xxx;
ERROR: relation "table_xxx" does not exist
LINE 1: select * from table_xxx;
^
testdb01=>
By designation schema.table Method can be queried :
testdb01=> select * from public.table_xxx;
id |
geom
| info
----+----------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------+------
1 | 0106000060E6100000010000000103000040010000000A0000005CA3069F2FFD32C01617D009928A314000000000000000005CA3069F2FFD32C01617D009928A31400000000000000000F26B4654041734C0D
45267B6B8402E40000000000000000087509FE8767C33C00F31DA54768A27400000000000000000ED227148639827C03CED065869052B400000000000000000970F062DBC2C26C0D661FB6F64DC3140000000000000
0000C7057482A4EA2DC077A0CC5DDD6733400000000000000000085869C54CBA2FC0AA89B58DD31530400000000000000000085869C54CBA2FC0AA89B58DD315304000000000000000005CA3069F2FFD32C01617D00
9928A31400000000000000000 | aaa
2 | 0106000060E610000001000000010300004001000000060000002E4AB9F2C12028C07A4C81C0032528400000000000000000DCC6E95AA3862DC062DF5685DE6B234000000000000000001696C83FB5D423C06
6E1651998571A4000000000000000009C74F417FBB611C0A3EA85509FA8254000000000000000009C74F417FBB611C0A3EA85509FA8254000000000000000002E4AB9F2C12028C07A4C81C003252840000000000000
0000
| bbb
(2 rows)
testdb01=>
Find relevant troubleshooting points :
Looks like it isn't a case folding issue. Check search_path (SHOW search_path or SELECT current_setting('search_path')) and compare it to the schema the table is in (\dt+ tablename) to make sure the table is on the client's path.
1, First confirm whether the table name is case sensitive , Obviously , I'm not
2, Check search_path ( SHOW search_path; )
testdb01=> SHOW search_path;
search_path
------------------------
"$user", public, tiger
(1 row)
testdb01=> \dn;
List of schemas
Name | Owner
-------------+----------
public | postgres
public | test
tiger | postgres
tiger_data | postgres
topology | postgres
(5 rows)
testdb01=> \dt+ public.table_xxx;
List of relations
Schema | Name | Type | Owner | Size | Description
-------------+----------------------+-------+-------+-------+-------------
public | table_xxx | table | test | 16 kB |
(1 row)
I create a new mode public No settings search_path, Use SQL Command is not specified schema, Therefore, the error report does not exist .
If you want to set search_path As follows :
According to the database settings search_path
ALTER database "db_xxx" SET search_path TO "schema_xxx";
According to user settings search_path
ALTER user "user_xxx" SET search_path TO "schema_xxx";
I use it by default public,public Only for temporary testing , therefore , I won't change it here , When using the command, add schema.table To avoid the problem
边栏推荐
- [MySQL] 15 super detailed MySQL date type function summary
- Navicat 16 是否支持原生苹果 Silicon M1 芯片?| 苹果用户必读
- Concurrent programming (19) -aqs of JUC
- Oracle 使用数据操作函数
- 使用 JDBCUtil完成数据库增删改查
- Force buckle 26 Delete duplicates in the ordered array 88 Merge two ordered arrays and 189 Rotate array
- 【MySQL】MySQL中多表连接的背景、笛卡尔积的错误与如何正确地多表查询
- 【MySQL】MySQL内连接和外连接详细总结
- Deep analysis of data storage in memory
- 手把手带你自定义 Gradle 插件 —— Gradle 系列(2)
猜你喜欢
MySQL在线升级方案
Concurrent programming (XXII) -reentrantlock condition variable implementation principle
[pytorch tutorial] 04 - explain the update of pre training model loading in torchvision 0.13 and the solution to error reporting (latest in 2022)
Simulate the implementation of string functions and memory functions (strlen, strcpy, strstr, memcpy
SQL SERVER索引基础详解___概念及原理
[MySQL] 19-how to create and manage databases in MySQL
VMware出现“该虚拟机似乎正在使用中”问题
【MySQL】MySQL中多表连接的背景、笛卡尔积的错误与如何正确地多表查询
Peoplesoft- 警告、错误、消息盒子
Concurrent programming (XXVII) - Atomic classes of JUC
随机推荐
PostGIS 空间数据(geometry)管理常用命令
Concurrent programming (XXVI) -reentrantlock application
(note) Wu Enda's in-depth study l4w2
[pytorch tutorial] 02- how to obtain the shape dimension, data type and device of tensor
关于Azure SQL DW中insert语句的注意事项
peoplecode 变量
Detailed explanation of Minio
Redis (I) - redis quick start
投票 | 选出您希望Navicat支持的数据库
Centos 安装MySQL 5.7.38
为SQL SERVER配置报警邮件
数据库监控的重要性
Oracle processes和sessions参数(进程连接数&会话连接数)
有小伙伴说看不懂 LiveData、Flow、Channel,跟我走
MySQL主从复制详解
[MySQL] classification of multi table query 2: self connected and non self connected
C language 2022 Shanxi upgraded C language knowledge points
Wu Enda deep learning l4w3 target detection
Oracle connection table
【MySQL】多表查询的分类1:等值连接和非等值连接