Case sensitivity

Started by Dev Kumkarabout 12 years ago9 messages
#1Dev Kumkar
devdas.kumkar@gmail.com

How to create case insensitive database?

I know about CITEXT data type, but what am looking for is if there any
parameter at database level which just makes the database case insensitive.

I mean both values 'ABC' and 'abc' are treated same for inserts and also
all the comparisons by default are case insensitive.

Was not able to find anything concrete forums, hope I didn't overlook
anything here.

Regards...

#2John R Pierce
pierce@hogranch.com
In reply to: Dev Kumkar (#1)
Re: Case sensitivity

On 12/10/2013 10:31 PM, Dev Kumkar wrote:

I know about CITEXT data type, but what am looking for is if there any
parameter at database level which just makes the database case
insensitive.

there's nothing that will do that in postgres.

whats wrong with using CITEXT ?

--
john r pierce 37N 122W
somewhere on the middle of the left coast

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Dev Kumkar
devdas.kumkar@gmail.com
In reply to: John R Pierce (#2)
Re: Case sensitivity

Thanks John.

Yes CITEXT would work, the only thing its needs DDL changes across and
hence was looking for any such global database parameter setting while
creating database. I have been looking at other discussions and doesn't
look like anything of that coming up soon that makes database case
insensitive.

regards...

On Wed, Dec 11, 2013 at 12:10 PM, John R Pierce <pierce@hogranch.com> wrote:

On 12/10/2013 10:31 PM, Dev Kumkar wrote:

I know about CITEXT data type, but what am looking for is if there any
parameter at database level which just makes the database case insensitive.

there's nothing that will do that in postgres.

whats wrong with using CITEXT ?

--
john r pierce 37N 122W
somewhere on the middle of the left coast

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
:o) dev

#4Dev Kumkar
devdas.kumkar@gmail.com
In reply to: Dev Kumkar (#3)
Re: Case sensitivity

Can case-insensitive collation help here?

On Wed, Dec 11, 2013 at 4:55 PM, Dev Kumkar <devdas.kumkar@gmail.com> wrote:

Show quoted text

Thanks John.

Yes CITEXT would work, the only thing its needs DDL changes across and
hence was looking for any such global database parameter setting while
creating database. I have been looking at other discussions and doesn't
look like anything of that coming up soon that makes database case
insensitive.

regards...

On Wed, Dec 11, 2013 at 12:10 PM, John R Pierce <pierce@hogranch.com>wrote:

On 12/10/2013 10:31 PM, Dev Kumkar wrote:

I know about CITEXT data type, but what am looking for is if there any
parameter at database level which just makes the database case insensitive.

there's nothing that will do that in postgres.

whats wrong with using CITEXT ?

#5Andrew Sullivan
ajs@crankycanuck.ca
In reply to: Dev Kumkar (#3)
Re: Case sensitivity

On Wed, Dec 11, 2013 at 04:55:07PM +0530, Dev Kumkar wrote:

creating database. I have been looking at other discussions and doesn't
look like anything of that coming up soon that makes database case
insensitive.

You could build lower() indexes on any column you want to search CI
and lower() all the input text during searches, in order to avoid any
work on the schema. Bit of a kludge, though.

Best,

A

--
Andrew Sullivan
ajs@crankycanuck.ca

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#6Dev Kumkar
devdas.kumkar@gmail.com
In reply to: Andrew Sullivan (#5)
Re: Case sensitivity

Actually for searches lower will work.
But the other important aspect is 'inserts' which would result 2 rows if
the values are 'A' and 'a'. Intent here to have it case insensitive.

If CITEXT it will update the same row and works.
CITEXT is an alternative but was wondering if there is any other alternate
solution/setting while creating database.

Also does CITEXT fetch via JDBC works the same way as fetch/set string
values? Any quick comments here.
http://techie-experience.blogspot.in/2013/04/hibernate-supporting-case-insensitive.html

Regards...

On Wed, Dec 11, 2013 at 8:58 PM, Andrew Sullivan <ajs@crankycanuck.ca>wrote:

Show quoted text

On Wed, Dec 11, 2013 at 04:55:07PM +0530, Dev Kumkar wrote:
You could build lower() indexes on any column you want to search CI
and lower() all the input text during searches, in order to avoid any
work on the schema. Bit of a kludge, though.

Best,

A

#7Dev Kumkar
devdas.kumkar@gmail.com
In reply to: Dev Kumkar (#6)
Re: Case sensitivity

On Wed, Dec 11, 2013 at 9:47 PM, Dev Kumkar <devdas.kumkar@gmail.com> wrote:

Actually for searches lower will work.
But the other important aspect is 'inserts' which would result 2 rows if
the values are 'A' and 'a'. Intent here to have it case insensitive.

If CITEXT it will update the same row and works.
CITEXT is an alternative but was wondering if there is any other alternate
solution/setting while creating database.

Also does CITEXT fetch via JDBC works the same way as fetch/set string
values? Any quick comments here.

http://techie-experience.blogspot.in/2013/04/hibernate-supporting-case-insensitive.html

Regards...

Also if the key columns are CITEXT is there any performance issues on
indexes?

#8Dev Kumkar
devdas.kumkar@gmail.com
In reply to: Dev Kumkar (#7)
Re: Case sensitivity

+ hackers

On Thu, Dec 12, 2013 at 12:34 PM, Dev Kumkar <devdas.kumkar@gmail.com>wrote:

Show quoted text

On Wed, Dec 11, 2013 at 9:47 PM, Dev Kumkar <devdas.kumkar@gmail.com>wrote:

Actually for searches lower will work.
But the other important aspect is 'inserts' which would result 2 rows if
the values are 'A' and 'a'. Intent here to have it case insensitive.

If CITEXT it will update the same row and works.
CITEXT is an alternative but was wondering if there is any other
alternate solution/setting while creating database.

Also does CITEXT fetch via JDBC works the same way as fetch/set string
values? Any quick comments here.

http://techie-experience.blogspot.in/2013/04/hibernate-supporting-case-insensitive.html

Regards...

Also if the key columns are CITEXT is there any performance issues on
indexes?

#9Dev Kumkar
devdas.kumkar@gmail.com
In reply to: Dev Kumkar (#8)
Re: [GENERAL] Case sensitivity

On Thu, Dec 12, 2013 at 12:47 PM, Dev Kumkar <devdas.kumkar@gmail.com>wrote:

+ hackers

On Thu, Dec 12, 2013 at 12:34 PM, Dev Kumkar <devdas.kumkar@gmail.com>wrote:

On Wed, Dec 11, 2013 at 9:47 PM, Dev Kumkar <devdas.kumkar@gmail.com>wrote:

Actually for searches lower will work.
But the other important aspect is 'inserts' which would result 2 rows if
the values are 'A' and 'a'. Intent here to have it case insensitive.

If CITEXT it will update the same row and works.
CITEXT is an alternative but was wondering if there is any other
alternate solution/setting while creating database.

Also does CITEXT fetch via JDBC works the same way as fetch/set string
values? Any quick comments here.

http://techie-experience.blogspot.in/2013/04/hibernate-supporting-case-insensitive.html

Regards...

Also if the key columns are CITEXT is there any performance issues on
indexes?

I am ok with CITEXT but for changing the database design for the

primary/foreign key columns to be CITEXT need some suggestions/comments
regarding performance for inserts/reads.

Awaiting...