Re: empty string casting to typed value

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: sad <sad(at)bankir(dot)ru>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: empty string casting to typed value
Date: 2004-06-07 13:59:44
Message-ID: 20040607135944.GA16564@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, Jun 07, 2004 at 10:37:44 +0400,
sad <sad(at)bankir(dot)ru> wrote:
> Hello
>
> It is clear that '' is a bad integer or timestamp representation
>
> but during the user input NULLs are usually represented with empty strings
> sometimes bunch of 'if empty' instructions grows huge
> (and in case of casting to timestamp apostrophes make sense)

An empty string is not an obvious particular time. Different applications
might treat this differently. Not applicable, missing, and current time
are all reasonable defaults.

>
> Why you prohibit casting ''::int to NULL ?
> What would you advice ?

The application should handle mapping appropiate inputs to NULL or perhaps
DEFAULT.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2004-06-07 14:34:53 Re: empty string casting to typed value
Previous Message Karel Zak 2004-06-07 09:46:46 Re: Formatting problems with negative intervals, TO_CHAR