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

Re: Enforcing Case

From: "paul butler" <paul(at)entropia(dot)co(dot)uk>
To: JDK <adahma(at)starport(dot)org>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Enforcing Case
Date: 2002-08-22 15:47:53
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
>  have a small single table database that multiple people enter data
> into, and I do some reporting from.  I would like to be able to force
> everything to upper case because currently it seems that ABCD or abcd
> or AbCd are all treated as unique, and it cause me problems in
> reporting, not to mention it makes me nuts seeing the data in the
> tables all inconsistent like that.
> How would I force everything to upper case?

Would using the upper function work?

for your data entry query

insert into table (field) values (upper(value));

It'll be ok for new entries, but you'll have to do some wrangling on 
the old ones if they are to remain unique.

Or on the output side

select upper(field)  from table

Hope this helps

Paul Butler


pgsql-novice by date

Next:From: Rod KreislerDate: 2002-08-22 15:52:53
Subject: Re: Enforcing Case
Previous:From: Chad ThompsonDate: 2002-08-22 15:04:34
Subject: Re: Simple but slow

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