From: | Darren Ferguson <darren(at)crystalballinc(dot)com> |
---|---|
To: | missive(at)hotmail(dot)com |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Data in a field must be in capitals |
Date: | 2002-02-08 04:40:54 |
Message-ID: | Pine.LNX.4.10.10202072339170.11746-100000@thread.crystalballinc.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Ok i dont know if t was ansered but the first part
Use atrigger on the table and just yse the inbuilt UPPER command that
Postgres supports and that will aways convert that field to upper case
Hope this helps
Darren
Darren Ferguson
On Fri, 8 Feb 2002, Lee Harr wrote:
> > 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.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
From | Date | Subject | |
---|---|---|---|
Next Message | Chris Lee | 2002-02-08 06:32:52 | 7.2 Upgrade problems: Cannot restore from pg_dumpall |
Previous Message | Lee Harr | 2002-02-08 03:11:29 | Re: Data in a field must be in capitals |