Re: ERROR: column "id" does not exist

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Sandro Daehler <sandro(dot)daehler(at)solnet(dot)ch>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ERROR: column "id" does not exist
Date: 2004-11-17 01:05:06
Message-ID: 20041117010505.GA45032@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message matthias 2004-11-17 01:17:16 How to suppress echo while executing batch files?
Previous Message matthias 2004-11-17 00:58:21 Problems importing Unicode