PG表名测试

    xiaoxiao2021-03-25  194

    postgres=# create table "myTable" (id int); CREATE TABLE postgres=# select * from mytable postgres-# ; ERROR: relation "mytable" does not exist LINE 1: select * from mytable ^ postgres=# select * from myTable; ERROR: relation "mytable" does not exist LINE 1: select * from myTable; ^ postgres=# select * from "myTable"; id ---- (0 rows) postgres=# create table mytable(id int); CREATE TABLE postgres=# select * from "mytable"; id ---- (0 rows) postgres=# select * from "mYtable"; ERROR: relation "mYtable" does not exist LINE 1: select * from "mYtable"; ^ postgres=# select * from mytable; id ---- (0 rows) postgres=# select * from MyTabLe; id ---- (0 rows) postgres=# 即:创建表时,加了双引号,那么查询的时候要以相同格式加双引号;默认将表名转为小写。
    转载请注明原文地址: https://ju.6miu.com/read-1600.html

    最新回复(0)