Skip site navigation (1) Skip section navigation (2)

syntax issue with insert statement

From: David Bear <David(dot)Bear(at)asu(dot)edu>
To: pgsql-admin(at)postgresql(dot)org
Subject: syntax issue with insert statement
Date: 2005-01-13 17:17:47
Message-ID: 20050113171747.7A314FB3@moroni.pp.asu.edu (view raw or flat)
Thread:
Lists: pgsql-admin
I'm in process of migrating data. That means lots of data munging.

I decided that while I'm coding I should go ahead and create sql syntax rather
than just some delimited file. So  I produced the following code:

docflow=> INSERT INTO student (first_name, last_name, middle_name, added_by,
    affiliate_id, added_on) VALUES (John, Doe, -, '{john}', 484848484, 02/02/20); 

ERROR:  syntax error at or near "," at character 112


I could not get the INSERT statement to work using the column name VALUES
syntax.

So, then I tried:

docflow=> INSERT INTO student VALUES (29394959, David, Doe, _, 09/09/99, '{test}')

That worked.

I though I might have quoting issue, but I'm sticking with lower case
identifiers.

This seems like such a trivial question, but I just cant see where I went
wrong. Maybe I've stared at it too long. Please advise.

--
David Bear
phone: 	480-965-8257
fax: 	480-965-9189
College of Public Programs/ASU
Wilson Hall 232
Tempe, AZ 85287-0803
 "Beware the IP portfolio, everyone will be suspect of trespassing"

Responses

pgsql-admin by date

Next:From: Scott MarloweDate: 2005-01-13 17:18:32
Subject: Re: Installing PostgreSQL as "postgress" versus "root"
Previous:From: John AllgoodDate: 2005-01-13 17:00:38
Subject: Setting Up Clustering for Postgres

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group