Re: [SQL] rewriting values with before trigger - Mailing list pgsql-general

From Robert Treat
Subject Re: [SQL] rewriting values with before trigger
Date
Msg-id 1051209495.7747.544.camel@camel
Whole thread Raw
In response to Re: [SQL] rewriting values with before trigger  (Josh Berkus <josh@agliodbs.com>)
Responses Re: [SQL] rewriting values with before trigger
List pgsql-general
On Thu, 2003-04-24 at 12:39, Josh Berkus wrote:
> Robert,
>
> > Is there anyway to do be able to change the '' into NULL before data
> > validity is checked with a trigger?
>
> What about using a RULE instead?
>

RULE's follow this same behavior, erroring out if the data is not a
valid timestamp. (At least I've not been able to write a rule that
doesn't follow this) In fact you actually can't create the rule if you
have a where clause that isn't a proper matching datatype.

I seem to recall a solution for folks who need '' to represent 0 in int
fields was to use triggers or rules, but I guess that really isn't
possible :-(

Robert Treat




pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Factoring where clauses through UNIONS take 2
Next
From: Dennis Gearon
Date:
Subject: Re: [SQL] rewriting values with before trigger