Обсуждение: psql problem

Поиск
Список
Период
Сортировка

psql problem

От
Rick Parker
Дата:
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

От
Ed Loehr
Дата:
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

От
"Mitch Vincent"
Дата:
> > 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

От
Volker Paul
Дата:
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