Re: PostgreSQL said: ERROR: Attribute 'id' not found

From: Darren Ferguson <darren(at)crystalballinc(dot)com>
To: eric(dot)jones(at)hua(dot)army(dot)mil
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL said: ERROR: Attribute 'id' not found
Date: 2002-04-10 00:19:36
Message-ID: Pine.LNX.4.10.10204092018380.17782-100000@thread.crystalballinc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

select * from s_users;
ID | fname | lname | ako | phone | email | rank_id |
status_id
----+--------+----------+-----+----------+--------------+---------+-----------
1 | Darren | Ferguson | ako | 49499494 | d
@phone.com | 5 | 3
(1 row)

dev=> select * from s_users where ID = 1;
ERROR: Attribute 'id' not found

dev=> select * from s_users where "ID" = 1;
ID | fname | lname | ako | phone | email | rank_id |
status_id
----+--------+----------+-----+----------+--------------+---------+-----------
1 | Darren | Ferguson | ako | 49499494 | d
@phone.com | 5 | 3
(1 row)

Postgres will convert ID to id unless you put "" around it.

So the system says id that aint a field in that table and throws an error

HTH

Darren Ferguson

On Tue, 9 Apr 2002 eric(dot)jones(at)hua(dot)army(dot)mil wrote:

> Hello All!
>
> Version - 7.2.1
> OS - FreeBSD
>
> I've encountered the following error when ever doing a select
> statement on any table in my DB:
>
> PostgreSQL said: ERROR: Attribute 'id' not found
>
> The select statement I'm doing is:
>
> select * from s_users where ID = 1;
>
> This fails when I do an "ID" or an "id".
>
> I've tried it both in PHP PG Admin and from the command line.
>
> My table looks like this:
>
> CREATE TABLE "s_users" (
> "ID" int8 DEFAULT nextval('"s_users_seq"'::text) NOT NULL,
> "fname" text NOT NULL,
> "lname" text NOT NULL,
> "ako" text NOT NULL,
> "phone" text,
> "email" text NOT NULL,
> "rank_id" int8,
> "status_id" int8 DEFAULT 2 NOT NULL,
> CONSTRAINT "s_users_pkey" PRIMARY KEY ("ID")
> );
>
> Anyone know why this is happening and how to fix it? Thanks in
> advance!
>
> Eric Jones (Contractor)
> FDIC Web Enabler
> E-mail: jonese(at)hua(dot)army(dot)mil
> Office - 520-533-6628
> Cell - 520-930-2136
> Email Pager - 5209802136(at)messaging(dot)nextel(dot)com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Lamar Owen 2002-04-10 02:00:44 Re: Problems building 7.2.1 RPMs
Previous Message Doug McNaught 2002-04-10 00:14:10 Re: PostgreSQL said: ERROR: Attribute 'id' not found