Re: Possible to insert quoted null value into integer field?

Поиск
Список
Период
Сортировка
От Jeff Boes
Тема Re: Possible to insert quoted null value into integer field?
Дата
Msg-id DVFZc.92531$JG7.32916@hydra.nntpserver.com
обсуждение исходный текст
Ответ на Re: Possible to insert quoted null value into integer field?  (Gaetano Mendola <mendola@bigfoot.com>)
Список pgsql-general
Gaetano Mendola wrote:
>
>>> And IIRC for oracle an empty string is a NULL value  :-(
>>
>>
>>
>> Who cares about Oracle? They are different things in the ANSI standard.
>
>
> :-(
> ^^^
>

Seems like you could handle this with a rule:

create rule as on insert to my_table
where new.that_column = '' do instead
insert into my_table (col_a, col_b, that_col)
values (new.col_a, new.col_b, NULL);

Or would this break long before the rule got involved, because
new.that_column has a bad value?

--
(Posted from an account used as a SPAM dump. If you really want to get
in touch with me, dump the 'jboes' and substitute 'mur'.)
________
Jeffery Boes <>< jboes@qtm.net

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

Предыдущее
От: Jeff Boes
Дата:
Сообщение: Re: Join efficiency
Следующее
От: Daniel Martini
Дата:
Сообщение: Re: The future of built-in geometric data types