Re: ERROR: column "id" does not exist

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: ERROR: column "id" does not exist
Дата
Msg-id 20041117010505.GA45032@winnie.fuhr.org
обсуждение исходный текст
Ответ на ERROR: column "id" does not exist  (Sandro Daehler <sandro.daehler@solnet.ch>)
Список pgsql-general
On Mon, Nov 15, 2004 at 01:44:47PM +0100, Sandro Daehler wrote:

> SELECT MAX(id) FROM apconfig;
>
> if i send this statement i got the following error:
>
> ERROR: column "id" does not exist
>
> Can anyone explain me this error? There is the column id, and there are
> also entries in it.

The column might have a different case or possibly leading or
trailing spaces, in which case you'll have to quote it verbatim.
What does \d apconfig show?  If that doesn't show the problem
then try this:

SELECT quote_ident(attname) FROM pg_attribute
WHERE attrelid = 'apconfig'::regclass;

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

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

Предыдущее
От: matthias@cmklein.de
Дата:
Сообщение: Problems importing Unicode
Следующее
От: matthias@cmklein.de
Дата:
Сообщение: How to suppress echo while executing batch files?