pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: sad <sad@bankir.ru>
Cc: pgsql-sql@postgresql.org
Subject: Re: empty string casting to typed value
Date: Mon, 7 Jun 2004 08:59:44 -0500
Message-ID: <20040607135944.GA16564@wolff.to> (raw)
In-Reply-To: <200406071037.44547.sad@bankir.ru>
References: <200406071037.44547.sad@bankir.ru>

On Mon, Jun 07, 2004 at 10:37:44 +0400,
  sad <sad@bankir.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.



view thread (3+ messages)  latest in thread

Message-ID: <20040607135944.GA16564@wolff.to>
Permalink:  ../20040607135944.GA16564@wolff.to/
Also on:    postgresql.org/message-id/20040607135944.GA16564@wolff.to

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: bruno@wolff.to, sad@bankir.ru
  Subject: Re: empty string casting to typed value
  In-Reply-To: <20040607135944.GA16564@wolff.to>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox