Re: Insert NULL for '' - Mailing list pgsql-general

From Mike Mascari
Subject Re: Insert NULL for ''
Date
Msg-id 3EE9DDC0.7090402@mascari.com
Whole thread Raw
In response to Re: Insert NULL for ''  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Insert NULL for ''  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Insert NULL for ''  (Tino Wildenhain <tino@wildenhain.de>)
List pgsql-general
Tom Lane wrote:

> "Daniel Gehrke" <dgehrke@neusta.de> writes:
>
>>Is there any possibility to get postgresql to insert NULL when I do "insert
>>into foo (bar) values ('')?

...

> I can think of a couple of possible approaches:
>
> * Define a view in which the corresponding column is actually text not
> date

...

> * Give up and make the column be actually type text.

What would be really neat is the ability of CREATE CAST to override
the default implementation and at the same time let the override call
the "base" implementation, if necessary.

Mike Mascari
mascarm@mascari.com






pgsql-general by date:

Previous
From: Roland Glenn McIntosh
Date:
Subject: Re: How can I insert a UTF-8 character with psql?
Next
From: sector119@mail.ru
Date:
Subject: tsearch - v2 new dict