Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old November 22nd, 2005, 08:51 AM
Iker Arizmendi
Guest
 
Posts: n/a
Default ERROR: column 'xxx' does not exist (under v. 7.4.1)


Using psql and running as the owner of the table "app" I
try to access the columns of the table like so:

SELECT * FROM app;

which returns all the columns in the table including
the one I'm interested in, which is "companyID".
If instead I use something like:

SELECT companyID FROM app;

I get the following:

ERROR: column "companyid" does not exist

even though the column DOES exist (the previous query
returned "companyID" as one of the column headers). Any
suggestions as to what I might be missing? I'm running
Postgres 7.4.1.

Regards,
Iker



---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings




  #2  
Old November 22nd, 2005, 08:52 AM
Karsten Hilbert
Guest
 
Posts: n/a
Default Re: ERROR: column 'xxx' does not exist (under v. 7.4.1)

> the one I'm interested in, which is "companyID".
^^^^^^^^^^^[color=blue]
> SELECT companyID FROM app;[/color]
^^^^^^^^^[color=blue]
> ERROR: column "companyid" does not exist[/color]
^^^^^^^^^^^
Look closely at the capitalization and quoting.
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

  #3  
Old November 23rd, 2005, 12:26 AM
Joe Sunday
Guest
 
Posts: n/a
Default Re: ERROR: column 'xxx' does not exist (under v. 7.4.1)

On Thu, Feb 05, 2004 at 10:00:21AM -0500, Iker Arizmendi wrote:
[color=blue]
>
> Using psql and running as the owner of the table "app" I
> try to access the columns of the table like so:
>
> SELECT * FROM app;
>
> which returns all the columns in the table including
> the one I'm interested in, which is "companyID".
> If instead I use something like:
>
> SELECT companyID FROM app;
>
> I get the following:
>
> ERROR: column "companyid" does not exist
>[/color]

SELECT "companyID" FROM app;

You've stored a case sensitive column name in the table, but
by default Postgres will fold all identifiers to lower case
unless quoted.

--Joe

--
Joe Sunday <sunday@csh.rit.edu> http://www.csh.rit.edu/~sunday/
Computer Science House, Rochester Inst. Of Technology

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,414 network members.