Re: Converting empty input strings to Nulls - Mailing list pgsql-general

From Jeff Davis
Subject Re: Converting empty input strings to Nulls
Date
Msg-id 1212260065.6360.1.camel@jdavis
Whole thread Raw
In response to Converting empty input strings to Nulls  ("Ken Winter" <ken@sunward.org>)
List pgsql-general
On Sat, 2008-05-31 at 13:40 -0400, Ken Winter wrote:
> I'm looking for a way to trap this bad input at the database level, quietly
> convert the input empty strings to Null, and store the Null in the date
> column.  I tried a BEFORE INSERT OR UPDATE trigger evoking this function ...

You can replace your table with a view and use rules to transform the
updates and inserts.

Regards,
    Jeff Davis


pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Converting empty input strings to Nulls
Next
From: "Martin"
Date:
Subject: Re: Converting empty input strings to Nulls