0
DROP TABLE IF EXISTS workspace;

CREATE TABLE "workspace" (
            "wk_space" VARCHAR(100) NOT NULL,
            "token" TEXT,
            PRIMARY KEY("wk_space", "token")
        );
        
INSERT INTO "workspace" ("wk_space", "token") VALUES ("team1", "upreawnysoafa22sva") ON CONFLICT (wk_space, token) DO NOTHING;

SELECT * FROM workspace;

This will give an error saying column "team1" does not exist. If I replace the values ("team1", "upreawnysoafa22sva") to numbers like (11, 22), it works fine. I don't know what's going wrong.

3
  • 1
    use single quotes for column names. Double quotes are used for DB objects (tables, etc.). INSERT INTO "workspace" ("wk_space", "token") VALUES ('team1', 'upreawnysoafa22sva') Commented May 31, 2022 at 5:45
  • 1
    @Jesusbrother: I think you meant "use single quotes for column values" Commented May 31, 2022 at 6:38
  • @a_horse_with_no_name yup, thanks to correcting me (: Commented May 31, 2022 at 6:41

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.