pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
stupid insert error
5+ messages / 5 participants
[nested] [flat]

* stupid insert error
@ 2005-06-24 00:12 David Bear <David.Bear@asu.edu>
  2005-06-24 00:41 ` Re: stupid insert error Michael Fuhr <mike@fuhr.org>
  2005-06-24 00:46 ` Re: stupid insert error Bruno G. Albuquerque <balbuquerque@dba.com.br>
  2005-06-24 00:48 ` Re: stupid insert error Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 3 replies; 5+ messages in thread

From: David Bear @ 2005-06-24 00:12 UTC (permalink / raw)
  To: pgsql-admin

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?
-- 
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"



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: stupid insert error
  2005-06-24 00:12 stupid insert error David Bear <David.Bear@asu.edu>
@ 2005-06-24 00:41 ` Michael Fuhr <mike@fuhr.org>
  2 siblings, 0 replies; 5+ messages in thread

From: Michael Fuhr @ 2005-06-24 00:41 UTC (permalink / raw)
  To: David Bear <David.Bear@asu.edu>; +Cc: 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/



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: stupid insert error
  2005-06-24 00:12 stupid insert error David Bear <David.Bear@asu.edu>
@ 2005-06-24 00:46 ` Bruno G. Albuquerque <balbuquerque@dba.com.br>
  2 siblings, 0 replies; 5+ messages in thread

From: Bruno G. Albuquerque @ 2005-06-24 00:46 UTC (permalink / raw)
  To: David Bear <David.Bear@asu.edu>; +Cc: pgsql-admin


Try single quotes (') instead of double-quotes (").

-Bruno

On Thu, 23 Jun 2005 17:12:03 -0700, David Bear said:

> 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?
> -- 
> 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"
> 
> ---------------------------(end of broadcast)------------------------
> ---
> TIP 4: Don't 'kill -9' the postmaster


**********************************************************************
Informação transmitida destina-se apenas à pessoa a quem foi endereçada e pode conter informação confidencial, legalmente protegida e para conhecimento exclusivo do destinatário. Se o leitor desta advertência não for o seu destinatário, fica ciente de que sua leitura, divulgação ou cópia é estritamente proibida. Caso a mensagem tenha sido recebida por engano, favor comunicar ao remetente e apagar o texto de qualquer computador.


The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by person or entity other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
**********************************************************************



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: stupid insert error
  2005-06-24 00:12 stupid insert error David Bear <David.Bear@asu.edu>
@ 2005-06-24 00:48 ` Tom Lane <tgl@sss.pgh.pa.us>
  2 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2005-06-24 00:48 UTC (permalink / raw)
  To: David.Bear@asu.edu; +Cc: pgsql-admin

David Bear <David.Bear@asu.edu> writes:
> 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

You want single quotes not double quotes.  Double quotes are for
identifiers, single quotes are for literals.  See
http://www.postgresql.org/docs/8.0/static/sql-syntax.html#SQL-SYNTAX-IDENTIFIERS
and the following section.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: stupid insert error
@ 2005-06-24 00:53 李江华 <ljh1469@alibaba-inc.com>
  0 siblings, 0 replies; 5+ messages in thread

From: 李江华 @ 2005-06-24 00:53 UTC (permalink / raw)
  To: David.Bear@asu.edu <David.Bear@asu.edu>; pgsql-admin

David Bear,您好!

	yes.of course.
    you should insert the record like this:
    insert into person3 (asuid, fname, lname, addedby, addedon,
    slopbucket) values ('123455', 'name', 'name', 'entered', '12/12/2004', '');

======= 2005-06-24 08:12:03 您在来信中写道:=======

>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?
>-- 
>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"
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Don't 'kill -9' the postmaster
>

= = = = = = = = = = = = = = = = = = = =
			

        致
礼!
 
				 
        李江华
        ljh1469@alibaba-inc.com
          2005-06-24



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2005-06-24 00:53 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-06-24 00:12 stupid insert error David Bear <David.Bear@asu.edu>
2005-06-24 00:41 ` Michael Fuhr <mike@fuhr.org>
2005-06-24 00:46 ` Bruno G. Albuquerque <balbuquerque@dba.com.br>
2005-06-24 00:48 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-06-24 00:53 Re: stupid insert error 李江华 <ljh1469@alibaba-inc.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox