Re: How to force some char type columns to be stored in uppercase - Mailing list pgsql-general

From Scott Marlowe
Subject Re: How to force some char type columns to be stored in uppercase
Date
Msg-id CAOR=d=3o5oaLTDY5BKpN9mh=DweX+CySgLypMm_Pd9U_338f8A@mail.gmail.com
Whole thread Raw
In response to How to force some char type columns to be stored in uppercase  ("Andrus" <kobruleht2@hot.ee>)
List pgsql-general
2011/11/6 Andrus <kobruleht2@hot.ee>:
> in 8.1+ many char(n) type columns must be in uppercase in database.
> What is best way to force this ?
>
> Should insert and update triggers created for every table or is there better
> way,
> for example by creation domain or adding some attribute to column and
> creating global trigger?

A simple trigger like this should work fine. You're basically throwing
an upper() around the field in a function and calling that a trigger.
If you decided to do it in the application, then throwing a constraint
around each updated / inserted text col is pretty easy too.

pgsql-general by date:

Previous
From: Sim Zacks
Date:
Subject: Re: How to find owning schema in function
Next
From: NTPT
Date:
Subject: Re: Re: [GENERAL] Named / preparsed / preplaned(prepared) queries - Feature proposal