upper case constraint?
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
"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
Import Notes
Reply to msg id not found: GoweyGeoffrey'smessageofTue25Sep2001124358-0400
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';
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