4

So I have been working on the following sql script and I can't seem to figure out why it keeps telling me that the data I am inserting is in a column that doesn't exist. Can anyone more experianced with Postgre help me out?

DROP SCHEMA pomodoro CASCADE;
CREATE SCHEMA pomodoro;
CREATE TABLE pomodoro.users
(
    uid smallint NOT NULL,
    username text NOT NULL,
    password text NOT NULL,
    weekly_goals bytea,
    CONSTRAINT users_pkey PRIMARY KEY (uid)
) WITH (OIDS=FALSE);

INSERT INTO pomodoro.users (uid, username,password)
VALUES (1,"dan","pass");

The error I am getting is:

INSERT INTO pomodoro.users (uid, username,password)
VALUES (1,"dan","pass");
psql:database-backup/start-script.sql:27: ERROR:  column "dan" does not exist
LINE 2: VALUES (1,"dan","pass");
2
  • 9
    single-quotes for strings, double-quotes for column-names. Commented Apr 28, 2017 at 2:38
  • Thanks! That worked Commented Apr 28, 2017 at 2:40

1 Answer 1

17

Double quotes are used to specify the column name , So you can insert like:

INSERT INTO pomodoro.users (uid, username,password) VALUES (1,'dan','pass');
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.