postgresqlsql-insertstring-constant

Inserting values into a table not working


I am trying to insert a value(row) into my table users but it's giving error that column doesn't exist.

User table: users

insert into users (id,name,gender,city,age,company) 
values (1,omkar,"male","cuttack",24,"tcs");

I am getting column does not exists. And with some specific values I am getting hint don't know why. Error screenshot


Solution

  • You must use single quotes for literal string values. Double quoting is interpreted as being an identifier, in this case a column name, which causes the error.

    insert into users (id,name,gender,city,age,company) 
    values (1,'omkar','male','cuttack',24,'tcs');