Обсуждение: Problem with my query whithout double-quotes

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

Problem with my query whithout double-quotes

От
ROUWEZ Stephane
Дата:
Hi, 
My pgsql runs on WinNT Server 4. When I try to 
SELECT nom, prenom FROM individu WHERE numero=2 
I have : ERROR: Relation "individu" does not exist 
It only works if I write : 
SELECT "Individu"."Nom","Individu"."Prenom" FROM "Individu" WHERE
"Individu"."NumIndiv"=2 
Can someone help me ? 
Thanks 
Stephane



------------------------------ 
http://www.ecolo.be 



Re: Problem with my query whithout double-quotes

От
Stephan Szabo
Дата:
On Wed, 24 Jul 2002, ROUWEZ Stephane wrote:

> Hi,
> My pgsql runs on WinNT Server 4. When I try to
> SELECT nom, prenom FROM individu WHERE numero=2
> I have : ERROR: Relation "individu" does not exist
> It only works if I write :
> SELECT "Individu"."Nom","Individu"."Prenom" FROM "Individu" WHERE
> "Individu"."NumIndiv"=2
> Can someone help me ?

It looks like you created the table with double quotes around the
names at which point you should always use double quotes to refer
to it (yes, if the name was "foo" you *can* refer to it as foo, but
you really shouldn't).



Re: Problem with my query whithout double-quotes

От
Keith Gray
Дата:
Stephan Szabo wrote:

> On Wed, 24 Jul 2002, ROUWEZ Stephane wrote:
> 
> 
>>Hi,
>>My pgsql runs on WinNT Server 4. When I try to
>>SELECT nom, prenom FROM individu WHERE numero=2
>>I have : ERROR: Relation "individu" does not exist
>>It only works if I write :
>>SELECT "Individu"."Nom","Individu"."Prenom" FROM "Individu" WHERE
>>"Individu"."NumIndiv"=2
>>Can someone help me ?
>>
> 
> It looks like you created the table with double quotes around the
> names at which point you should always use double quotes to refer
> to it (yes, if the name was "foo" you *can* refer to it as foo, but
> you really shouldn't).


Your table names are case sensitive.
PostgreSQL will make them all lowercase by default,
unless you quote them.

-- 
Keith Gray

Technical Services Manager
Heart Consulting Services P/L
mailto:keith@heart.com.au