4

I have the following table definition:

foo=# \d+ tag
                                                       Table "public.tag"
   Column    |          Type          |                    Modifiers                     | Storage  | Stats target | Description 
-------------+------------------------+--------------------------------------------------+----------+--------------+-------------
 id          | integer                | not null default nextval('tag_id_seq'::regclass) | plain    |              | 
 name        | character varying(255) | not null                                         | extended |              | 
 version     | integer                | not null                                         | plain    |              | 
 description | character varying(255) | not null                                         | extended |              | 
 active      | boolean                | not null                                         | plain    |              | 
Indexes:
    "tag_pkey" PRIMARY KEY, btree (id)
    "unique_tag" UNIQUE CONSTRAINT, btree (name, version)

I am trying to insert a row into as follows:

foo=# insert into tag (name, version, description, active) values ("scala", 1, "programming language", true);
ERROR:  column "scala" does not exist
LINE 1: ... tag (name, version, description, active) values ("scala", 1...

I took this command from the manual but it doesn't work. What I am doing wrong? It's a simple thing but I'm stumped. First time I am using postgres.

1
  • Use single quotes in literals. Commented Aug 22, 2016 at 2:16

1 Answer 1

4

Postgres uses single quotes.

insert into tag (name, version, description, active) values ('scala', 1, 'programming language', true);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.