Re: Not able to find a table

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: Not able to find a table
Дата
Msg-id 42B89BBF-A558-45CB-A689-0713B0E0A65A@seespotcode.net
обсуждение исходный текст
Ответ на Not able to find a table  (Dale Seaburg <kg5lt@verizon.net>)
Список 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

instrument_type
InSTrument_type
INSTRUMENT_TYPE
Instrument_Type

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.,

SELECT *
FROM "Instrument_Type";

Michael Glaesemann
grzm seespotcode net



В списке pgsql-novice по дате отправления:

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: Not able to find a table
Следующее
От: Dale Seaburg
Дата:
Сообщение: Re: Not able to find a table