Thread: psql problem

psql problem

From
Rick Parker
Date:
Does anyone know why when I am in a particular DB as user postgres and use
the following statement, why I get this error?" 

This is the statement;
SELECT * FROM some_file where ID = 1;


----------------------------------------------------------------------------
Error: ERROR:  attribute 'id' not found
Execution time 0.02 sec.


But if I use the following statement, everything is returned fine.

SELECT * FROM servlet_file;


Thanks ahead of time,

Rick Parker



Re: psql problem

From
Ed Loehr
Date:
What is the definition of the table 'some_table'??

Regards,
Ed Loehr

Rick Parker wrote:
> 
> Does anyone know why when I am in a particular DB as user postgres and use
> the following statement, why I get this error?"
> 
> This is the statement;
> SELECT * FROM some_file where ID = 1;
> 
> ----------------------------------------------------------------------------
> Error: ERROR:  attribute 'id' not found
> Execution time 0.02 sec.
> 
> But if I use the following statement, everything is returned fine.
> 
> SELECT * FROM servlet_file;
> 
> Thanks ahead of time,
> 
> Rick Parker


Re: psql problem

From
"Mitch Vincent"
Date:
> > Does anyone know why when I am in a particular DB as user postgres and
use
> > the following statement, why I get this error?"
> >
> > This is the statement;
> > SELECT * FROM some_file where ID = 1;
> >
>
> --------------------------------------------------------------------------
--
> > Error: ERROR:  attribute 'id' not found
> > Execution time 0.02 sec.

That indicates that you have no column named 'id'..

> > But if I use the following statement, everything is returned fine.
> >
> > SELECT * FROM servlet_file;

That's a totally different query which would yeild totally different
results..

-Mitch





RE: psql problem

From
Volker Paul
Date:
Does anyone know why when I am in a particular DB as user postgres and use
the following statement, why I get this error?" 

This is the statement;
SELECT * FROM some_file where ID = 1;

[Volker Paul]  If your ID field is really uppercase, try:
SELECT * FROM some_file where "ID" = 1;

Cheers,

Volker