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

Re: stupid insert error

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: David Bear <David(dot)Bear(at)asu(dot)edu>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: stupid insert error
Date: 2005-06-24 00:41:33
Message-ID: 20050624004133.GA39472@winnie.fuhr.org (view raw or flat)
Thread:
Lists: pgsql-admin
On Thu, Jun 23, 2005 at 05:12:03PM -0700, David Bear wrote:
>
> I guess I'm too stupid to see the error, but I don't understand why
> the following fails.
> 
> insert into person3 (asuid, fname, lname, addedby, addedon,
> slopbucket) values ("123455", "name", "name", "entered", "12/12/2004", NULL);
> ERROR:  column "123455" does not exist
> 
> is the double quote byting me?

String constants use single quotes (or dollar quotes as of 8.0);
double-quoted strings are interpreted as identifiers.  See "Lexical
Structure" in the "SQL Syntax" chapter of the documentation:

http://www.postgresql.org/docs/8.0/static/sql-syntax.html#SQL-SYNTAX-LEXICAL

If I'm not mistaken, this distinction is defined in the SQL standard.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

pgsql-admin by date

Next:From: Bruno G. AlbuquerqueDate: 2005-06-24 00:46:23
Subject: Re: stupid insert error
Previous:From: David BearDate: 2005-06-24 00:12:03
Subject: stupid insert error

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