嗨我试图插入表tester3它使用语法失败
insert into tester3 (UN0, UN1) values ( 1, 'jishnu1');
Run Code Online (Sandbox Code Playgroud)
但
insert into tester3 values ( 1, 'jishnu1');
Run Code Online (Sandbox Code Playgroud)
工作正常.
mydb=# CREATE TABLE tester3
mydb-# (
mydb(# "UN0" integer,
mydb(# "UN1" VARCHAR(40)
mydb(# );
CREATE TABLE
mydb=# insert into tester3 (UN0, UN1) values ( 1, 'jishnu1');
ERROR: column "un0" of relation "tester3" does not exist
mydb=# \d tester3
Table "public.tester3"
Column | Type | Modifiers
--------+-----------------------+-----------
UN0 | integer |
UN1 | character varying(40) |
Run Code Online (Sandbox Code Playgroud)
我想我错过了一些非常微不足道的东西,我尝试了其他一些列名称,其中一些工作正常,一些不起作用.我很迷惑.PostgreSQL对列名的限制是否适用于插入查询的第一种语法?
编辑: 正如Gordon Linoff 所建议的 …
我正在尝试在 PostgreSQL 中创建一个表,但出现错误
create table bond ([Coupon.Type] varchar(35),[Coupon.Index] varchar(35),[Tranche.1] varchar(35),[Tranche.2] varchar(35))我尝试删除 "[" 和 as Coupon.Type,"Coupon.Type"但也没有任何效果。
ERROR: syntax error at or near "["
LINE 1: Room varchar(35),(Coupon.Type) varchar(35),[Coupon.Index] va...