Thread: Making field non case sensitive

Making field non case sensitive

From
Félix Sánchez Rodríguez
Date:
Greetings:
 
I need to be able to establish which fields of my tables are and which are not case sensitive. Is it possible?? How??
 
 

Re: Making field non case sensitive

From
Pawel Socha
Date:
2009/4/5 Félix Sánchez Rodríguez <fesanch@ciego.cult.cu>:
> Greetings:
>
> I need to be able to establish which fields of my tables are and which are
> not case sensitive. Is it possible?? How??
>
>

Use "your_field_name" for case-sensitive fields name.

,-[17:25:07]merlin@[local]:5432=
`-merlin>create table t10("Name" int);
CREATE TABLE
Time: 201.221 ms


--
Pawel Socha

Re: Making field non case sensitive

From
Scott Marlowe
Date:
2009/4/5 Félix Sánchez Rodríguez <fesanch@ciego.cult.cu>:
> Greetings:
>
> I need to be able to establish which fields of my tables are and which are
> not case sensitive. Is it possible?? How??

In what way, in how you refer to them or in how you compare them?
PostgreSQL has no built in case-insensitive types, but there is an
addon for citext or something like it that makes a case insensitive
type. Or you can make a case insensitive index and use that.

create table mytable (id int, field x int, fieldy int, field1 text);
create index mytable_field1 on mytable ((lower(field)));
select * from mytable where lower(field)='abc';