upper case constraint?

Started by Gowey, Geoffreyover 24 years ago4 messagesgeneral
Jump to latest
#1Gowey, Geoffrey
ggowey@rxhope.com

Just wondering if anyone knows off hand how to make it so all inserts on a
column will wind up being tranparently stored as uppercase (ex: ee1234567 =
EE1234567).

Geoff

#2Doug McNaught
doug@wireboard.com
In reply to: Gowey, Geoffrey (#1)
Re: upper case constraint?

"Gowey, Geoffrey" <ggowey@rxhope.com> writes:

Just wondering if anyone knows off hand how to make it so all inserts on a
column will wind up being tranparently stored as uppercase (ex: ee1234567 =
EE1234567).

Sounds like a good application for a trigger.

-Doug
--
In a world of steel-eyed death, and men who are fighting to be warm,
Come in, she said, I'll give you shelter from the storm. -Dylan

#3Stephan Szabo
sszabo@megazone23.bigpanda.com
In reply to: Gowey, Geoffrey (#1)
Re: upper case constraint?

On Tue, 25 Sep 2001, Gowey, Geoffrey wrote:

Just wondering if anyone knows off hand how to make it so all inserts on a
column will wind up being tranparently stored as uppercase (ex: ee1234567 =
EE1234567).

Probably a trigger, before update/insert on table:

create function gouppertable_col() returns opaque as '
begin
NEW.col := upper(NEW.col);
return NEW;
end;
' language 'plpgsql';

#4Pedro Alves
pmalves@think.co.pt
In reply to: Gowey, Geoffrey (#1)
Re: upper case constraint?

One turnarround solution I use for that is to make the convertion to
uppercase in the script prior to the insertion. If that is your case, u can
do that too. Nevertheless, it seem easy to make a function toupper(), if it
does not exists yet

On Tue, Sep 25, 2001 at 12:43:58PM -0400, Gowey, Geoffrey wrote:

Just wondering if anyone knows off hand how to make it so all inserts on a
column will wind up being tranparently stored as uppercase (ex: ee1234567 =
EE1234567).

Geoff

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

--
Pedro Miguel G. Alves

THINK - Tecnologias de Informa������o
Av. Defensores de Chaves n��� 15 4���D, 1000-109 Lisboa Portugal
Tel: +351 21 3590285 Fax: +351 21 3582729
HomePage: www.think.co.pt