Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Column does not exist, pgAdmin 4 [duplicate]

INSERT INTO public."LeadCustomer"(
    "CustomerID", "FirstName", "Surname", "BillingAddress", "Email")
    VALUES ("12", "Lola", "Smith", "24 Cashmere Lane, Lancashire, LA4 6QT", "[email protected]");

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
like image 358
Dani Miller Avatar asked Dec 13 '22 23:12

Dani Miller


1 Answers

You're getting this error be PostgreSQL uses double quotes (") to signify system identifiers (such as tables, columns, etc.) while using single quotes (') to signify text.

You want your query to be:

INSERT INTO public."LeadCustomer"(
    "CustomerID", "FirstName", "Surname", "BillingAddress", "Email")
    VALUES ('12', 'Lola', 'Smith', '24 Cashmere Lane, Lancashire, LA4 6QT', '[email protected]');
like image 174
MasterOdin Avatar answered Dec 29 '22 12:12

MasterOdin