Re: Enforcing Case

From: Rod Kreisler <rod(at)23net(dot)net>
To: paul(at)entropia(dot)co(dot)uk, JDK <adahma(at)starport(dot)org>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Enforcing Case
Date: 2002-08-22 15:52:53
Message-ID: JNEGKNDJGBKLBDGPOPFOEEHDDAAA.rod@23net.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Or, if you want to make sure it is enforced by postgres, write a trigger
that'll use the upper() function to force the case after an insert.

> -----Original Message-----
> From: pgsql-novice-owner(at)postgresql(dot)org
> [mailto:pgsql-novice-owner(at)postgresql(dot)org]On Behalf Of paul butler
> Sent: Thursday, August 22, 2002 11:48 AM
> To: JDK
> Cc: pgsql-novice(at)postgresql(dot)org
> Subject: Re: [NOVICE] Enforcing Case
>
>
>
> > 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
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Mark Seftel 2002-08-22 17:43:57 changing the size of a column without losing data
Previous Message paul butler 2002-08-22 15:47:53 Re: Enforcing Case