From: | "amy cheng" <amycq(at)hotmail(dot)com> |
---|---|
To: | pgsql-general(at)postgreSQL(dot)org |
Subject: | change null to "" |
Date: | 1999-08-31 10:17:08 |
Message-ID: | 19990831171709.82874.qmail@hotmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
hi, all experts there,
it's me again :-)
I'm studying the example in postgresql-6.5.1/src/pl/plpgsql/test.
I have another question: why do we need to "Set backlink to empty string if
NULL value given"? is it JUST a test, or, some reasons to
do that in general?
Thanks!!!!!!!!!!!
amy
#################################################
-- ************************************************************
-- * BEFORE INSERT or UPDATE on all slots with backlink
-- * - Set backlink to empty string if NULL value given
-- ************************************************************
create function tg_chkbacklink() returns opaque as '
begin
if new.backlink isnull then
new.backlink := '''';
end if;
return new;
end;
' language 'plpgsql';
create trigger tg_chkbacklink before insert or update
on PSlot for each row execute procedure tg_chkbacklink();
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
From | Date | Subject | |
---|---|---|---|
Next Message | Marzullo Laurent | 1999-08-31 10:45:29 | Prog to generate table structure ... |
Previous Message | Pablo Sentis | 1999-08-31 10:09:19 | Referential integrity |