def=# create table test(c1 int,c2 text);
CREATE TABLE
def=# select count(*) from test;
ERROR: relation "test" does not exist
LINE 1: select count(*) from test;
可以发现数据库报错找不到该表
查看表的详细信息
def=# \d+
List of relations
Schema | Name | Type | Owner | Persistence | Access method | Size | Description
--------+-------+-------+----------+-------------+---------------+---------+-------------
public | a | table | postgres | permanent | heap | 0 bytes |
public | test | table | postgres | permanent | heap | 501 MB |
可以发现该表前面存在控格导致无法访问
而且数据库还能创建test表
def=# create table test (id int);
CREATE TABLE
def=# \d+
List of relations
Schema | Name | Type | Owner | Persistence | Access method | Size | Description
--------+-------+-------+----------+-------------+---------------+---------+-------------
public | a | table | postgres | permanent | heap | 0 bytes |
public | test | table | postgres | permanent | heap | 0 bytes |
public | test | table | postgres | permanent | heap | 501 MB |
(3 rows)
需要对该表进行操作可以粘贴name来实现。