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

Re: Not able to find a table

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: Dale Seaburg <kg5lt(at)verizon(dot)net>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Not able to find a table
Date: 2007-07-30 14:51:57
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
On Jul 30, 2007, at 9:26 , Dale Seaburg wrote:

> I have a database that can be accessed and used correctly via ODBC  
> and MS-Access.  But when I try to do a simple SQL SELECT query in  
> psql, I get an error that the table can't be found: Relation  
> "instrument_type" does not exist.  Yet, when I do a "\d" command, I  
> see the table named "Instrument_Type" in the "public" schema.

SQL is case-insensitive unless the identifier is quoted. PostgreSQL  
downcases unquoted identifiers, so


all are treated as instrument_type.

Note that \d returns "Instrument_Type". This means the identifier was  
quoted when created. "Instrument_Type" is not the same as  
Instrument_Type or instrument_type. You need to quote the identifier  
to use it, e.g.,

FROM "Instrument_Type";

Michael Glaesemann
grzm seespotcode net

In response to

pgsql-novice by date

Next:From: Dale SeaburgDate: 2007-07-30 15:45:45
Subject: Re: Not able to find a table
Previous:From: Michael FuhrDate: 2007-07-30 14:43:51
Subject: Re: Not able to find a table

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