PostgreSQL said: ERROR: Attribute 'id' not found 
Author Message
 PostgreSQL said: ERROR: Attribute 'id' not found

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



Sun, 26 Sep 2004 08:03:12 GMT
 PostgreSQL said: ERROR: Attribute 'id' not found

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

Office - 520-533-6628
Cell - 520-930-2136

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Sun, 26 Sep 2004 08:08:59 GMT
 PostgreSQL said: ERROR: Attribute 'id' not found

Quote:

> 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;

Try this:

SELECT * from s_users where "ID" = 1;

-Doug
--
Doug McNaught       Wireboard Industries      http://www.wireboard.com/

      Custom software development, systems and network consulting.
      Java PostgreSQL Enhydra Python Zope Perl Apache Linux BSD...

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate

message can get through to the mailing list cleanly



Sun, 26 Sep 2004 08:17:12 GMT
 PostgreSQL said: ERROR: Attribute 'id' not found

select * from s_users;
 ID | fname  |  lname   | ako |  phone   |    email     | rank_id |
status_id
----+--------+----------+-----+----------+--------------+---------+-----------

(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 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


Quote:
> 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

> Office - 520-533-6628
> Cell - 520-930-2136

> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


Sun, 26 Sep 2004 08:21:43 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. Attribute 'name' not found

2. Getting error saying it can't find VBSQL.VBX

3. Run-time error '3265': Item not found in this collection

4. Run-time error '3265': Item not found in this collection

5. 'Could not find stored procedure' Error

6. error '80004005' Invalid connection string attribute

7. XSL Error: The value of the 'method' attribute may not be 'html'.

8. How to modify fields linked to id's when the id's change

9. XSL Error: The value of the 'method' attribute may not be 'html'.

10. WHILE ID='::ID::' has me confused

11. Linking Unix Process Id's back to Session Id's

12. Could not find stored procedure 'sp_MSins_%'


 
Powered by phpBB® Forum Software