Search Postgresql Archives

Re: How to force some char type columns to be stored in uppercase

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2011/11/6 Andrus <kobruleht2@xxxxxx>:
> 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.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux