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.

user8314628
  • 1,952
  • 2
  • 22
  • 46
  • 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') – Jesusbrother May 31 '22 at 05:45
  • 1
    @Jesusbrother: I think you meant "*use single quotes for column **values***" –  May 31 '22 at 06:38
  • @a_horse_with_no_name yup, thanks to correcting me (: – Jesusbrother May 31 '22 at 06:41

0 Answers0