Re: empty string casting to typed value

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: empty string casting to typed value
Дата
Msg-id 20040607135944.GA16564@wolff.to
обсуждение исходный текст
Ответ на empty string casting to typed value  (sad <sad@bankir.ru>)
Список pgsql-sql
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.


В списке pgsql-sql по дате отправления:

Предыдущее
От: Karel Zak
Дата:
Сообщение: Re: Formatting problems with negative intervals, TO_CHAR
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: empty string casting to typed value