ERROR: column "id" does not exist

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sandro Daehler

    #1

    ERROR: column "id" does not exist

    Hy

    i have a problem with the following statement:

    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.

    thx



    ---------------------------(end of broadcast)---------------------------
    TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddres sHere" to majordomo@postg resql.org)

  • Michael Fuhr

    #2
    Re: ERROR: column "id&quo t; does not exist

    On Mon, Nov 15, 2004 at 01:44:47PM +0100, Sandro Daehler wrote:
    [color=blue]
    > 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.[/color]

    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(att name) FROM pg_attribute
    WHERE attrelid = 'apconfig'::reg class;

    --
    Michael Fuhr


    ---------------------------(end of broadcast)---------------------------
    TIP 8: explain analyze is your friend

    Comment

    Working...