Re: What is the best way to force character data to upper case

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Dennis <dennis(at)kabonkulator(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: What is the best way to force character data to upper case
Date: 2012-02-03 12:59:12
Message-ID: 4F2BDA20.4000501@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 02/02/2012 06:09, Dennis wrote:
> I am wondering what the best way is to force character data to a
> specific case, like upper case for example. Is a trigger or rule the
> only option? Would a check constraint be better or faster than using
> rules or triggers, knowing that a check constraint puts the onus back on
> the client code to ensure the data is in the correct case?

Use the upper() function.

http://www.postgresql.org/docs/9.1/static/functions-string.html

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jay Levitt 2012-02-03 14:58:32 Re: Extensions btree_gist and cube collide?
Previous Message Chris Travers 2012-02-03 12:57:44 Re: What is the best way to force character data to upper case