Re: Data in a field must be in capitals - Mailing list pgsql-general

From missive@frontiernet.net (Lee Harr)
Subject Re: Data in a field must be in capitals
Date
Msg-id a3vfl1$13oq$2@news.tht.net
Whole thread Raw
Responses Re: Data in a field must be in capitals  (Darren Ferguson <darren@crystalballinc.com>)
List pgsql-general
> I am using PostgreSQL7.1.3.
>
> I need to ensure that a project code is all in capitals (upper case) when it
> is stored in the database.
>
> To do this, should I use a trigger on an insert with a stored procedure, or
> a check constraint?
>
> I was planning on automatically converting lower case to upper case, rather
> than rejecting an invalid entry.
>

I was reading some of the comments on the PostgreSQL release story
on Slashdot and someone mentioned using functions for all regular
access to the database. It is an interesting idea.

Basically, the only access you give to insert in to the table
would be through a function, and you make sure your function
uppercases that particular field. Of course if people have access
to performing raw inserts then you would probably want a
trigger to verify the integrity of inserted data.


pgsql-general by date:

Previous
From: "Command Prompt, Inc."
Date:
Subject: S-ODBC in Final Testing
Next
From: Darren Ferguson
Date:
Subject: Re: Data in a field must be in capitals