From: | Richard Huxton <dev(at)archonet(dot)com> |
---|---|
To: | lucas(at)presserv(dot)org |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: Default on update |
Date: | 2005-11-23 14:08:03 |
Message-ID: | 438477C3.6080208@archonet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
lucas(at)presserv(dot)org wrote:
>>> I would want to replace "bv" values with FALSE when insert/update
>>> NULL value for
>>> this field.
>>
>> You could do this by having the application insert to a view with a
>> rule that replaces null bv values before redirecting to the base table.
>
> Is more functional to create a Rule instead of a trigger?
It's different - you can think of a rule as a kind of macro, rewriting
the query the application provides. Make sure you read the manuals
carefully to be sure you understand how they work though.
>>> Or need I create a TRIGGER that check it and replace the itens???
>>> CREATE or REPLACE function TG_table1_check RETURNS trigger as '
>>> BEGIN
>>> IF nullvalue(NEW.bv) THEN
>>
>>
>> IF NEW.bv IS NULL THEN
>>
> What is the difference between nullvalue() and IS NULL???
"IS NULL" is a standard SQL expression.
--
Richard Huxton
Archonet Ltd
From | Date | Subject | |
---|---|---|---|
Next Message | A. R. Van Hook | 2005-11-23 14:26:49 | sysid |
Previous Message | Fernando Garcia | 2005-11-23 14:07:22 | OUT OF THIS LIST...... |