0

when I run this in terminal:

INSERT INTO signup (username, user_password) VALUES("John", "dqw1");

It gives me: ERROR: column "John" does not exist.

What could be the problem here? this doesn't even make sense, the column name is username. "John" is just a value, it shouldn't exist before.

1
  • Use single quotes instead of double quotes Commented Oct 13, 2021 at 5:28

1 Answer 1

5

The issue is with the double quotes - postgres is interpreting them as "delimited identifiers" (i.e. the name of an object, such as a column in a table).

So instead of this:

INSERT INTO signup (username, user_password) VALUES("John", "dqw1");

Do this:

INSERT INTO signup (username, user_password) VALUES('John', 'dqw1');
Sign up to request clarification or add additional context in comments.

1 Comment

This is a FAQ - closing it as a duplicate would have been more useful. This behavior is dictated by the SQL standard.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.