列不存在,pgAdmin 4。

6
INSERT INTO public."LeadCustomer"(
    "CustomerID", "FirstName", "Surname", "BillingAddress", "Email")
    VALUES ("12", "Lola", "Smith", "24 Cashmere Lane, Lancashire, LA4 6QT", "lolasmith@gmail.com");

ERROR:  column "12" does not exist
LINE 3:  VALUES ("12", "Lola", "Smith", "24 Cashmere Lane, Lancashir...
                 ^
********** Error **********

ERROR: column "12" does not exist
SQL state: 42703
Character: 111

1
使用单引号将字符串括起来 - Jens
这是一个愚蠢的错误!谢谢。 - Dani Miller
1个回答

19
你遇到这个错误是因为PostgreSQL使用双引号(")来表示系统标识符(如表名、列名等),而使用单引号(')来表示文本。
你希望你的查询语句是:
INSERT INTO public."LeadCustomer"(
    "CustomerID", "FirstName", "Surname", "BillingAddress", "Email")
    VALUES ('12', 'Lola', 'Smith', '24 Cashmere Lane, Lancashire, LA4 6QT', 'lolasmith@gmail.com');

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接