Skip site navigation (1) Skip section navigation (2)

Re: primary key on lower(varchar)

From: <me(at)alternize(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: primary key on lower(varchar)
Date: 2006-01-07 05:29:21
Message-ID: 0d3101c6134b$50c858e0$0201a8c0@iwing (view raw or flat)
Thread:
Lists: pgsql-novice
 > I don't really see the use-case for what you want anyway.  Why don't
> you just require the field to be all lower case, eg with a CHECK
> constraint?

simple case: lets say the table "translated_names" contains an foreign key, 
the translated word and the language the word is in. obviously, 
"Brotaufstrich" and "brotaufstrich" must relate to the same record. if i'm 
just saving the records in lowercase (or uppercase) i'm loosing the proper 
letter case...

the workaround of adding 2 word fields (word_lower, word_normal)  and 
setting word_lower to primary key unfortunately wastes a lot of diskspace 
espially when the table grows large...

- thomas



In response to

Responses

pgsql-novice by date

Next:From: operationsengineer1Date: 2006-01-08 07:11:50
Subject: Re: primary key on lower(varchar)
Previous:From: Tom LaneDate: 2006-01-07 04:35:48
Subject: Re: primary key on lower(varchar)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group