Обсуждение: BUG #3430: Case Sensitive Table Names

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

BUG #3430: Case Sensitive Table Names

От
"Ashwin"
Дата:
The following bug has been logged online:

Bug reference:      3430
Logged by:          Ashwin
Email address:      ashwin_poddar@persistent.co.in
PostgreSQL version: 8.2.4
Operating system:   Linux
Description:        Case Sensitive Table Names
Details:

I have a strange problem,

I have created a Table with name Employee_Master
when i fire a  Query as
Select * from Employee_Master
it give me an error as employee_master doesnt Exists.
but when i rename my table name as employee_master
the query works fine...
is that necessary to have table names in small case????
Please help me...


Thanks,
Ashwin

Re: BUG #3430: Case Sensitive Table Names

От
Stéphane Schildknecht
Дата:
Ashwin a écrit :
> The following bug has been logged online:
>
> Bug reference:      3430
> Logged by:          Ashwin
> Email address:      ashwin_poddar@persistent.co.in
> PostgreSQL version: 8.2.4
> Operating system:   Linux
> Description:        Case Sensitive Table Names
> Details:
>
> I have a strange problem,
>
> I have created a Table with name Employee_Master
> when i fire a  Query as
> Select * from Employee_Master
> it give me an error as employee_master doesnt Exists.
> but when i rename my table name as employee_master
> the query works fine...
> is that necessary to have table names in small case????
> Please help me...
>
The other possibility would be to query your tables that way :

select * from "Employee_Master";

Which may not be that convenient.

Regards,
Stéphane




Re: BUG #3430: Case Sensitive Table Names

От
"Gurjeet Singh"
Дата:
On 7/6/07, Ashwin <ashwin_poddar@persistent.co.in> wrote:
>
>
> The following bug has been logged online:
>
> Bug reference:      3430
> Logged by:          Ashwin
> Email address:      ashwin_poddar@persistent.co.in
> PostgreSQL version: 8.2.4
> Operating system:   Linux
> Description:        Case Sensitive Table Names
> Details:
>
> I have a strange problem,
>
> I have created a Table with name Employee_Master
> when i fire a  Query as
> Select * from Employee_Master
> it give me an error as employee_master doesnt Exists.
> but when i rename my table name as employee_master
> the query works fine...
> is that necessary to have table names in small case????


Only if you have quoted the table  names while creating them.

For eg,  The following two commands will create tables with different names:

create table "Test"( a int );

create table "test"( a int );

create table "TesT"( a int );

Postgres converts all identifiers to lower-case, unless they are quoted.

HTH

--=20
gurjeet[.singh]@EnterpriseDB.com
singh.gurjeet@{ gmail | hotmail | indiatimes | yahoo }.com

EnterpriseDB      http://www.enterprisedb.com

17=B029'34.37"N  78=B030'59.76"E - Hyderabad
18=B032'57.25"N  73=B056'25.42"E - Pune *

Mail sent from my BlackLaptop device