Re: Problem with void integer

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Problem with void integer
Дата
Msg-id 20050530190532.GA2481@svana.org
обсуждение исходный текст
Ответ на Re: Problem with void integer  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
Please reply to the list so everyone can follow the discussion:

On Mon, May 30, 2005 at 07:50:03PM +0200, Alexandre Lollini wrote:
> Here is my query sample (exact):

<snip>

> INSERT INTO sometable ( someint4field ) VALUES ( '' );
>
> To work.

Sorry, an empty string is not an integer. If you want NULL, say NULL.

> Or find me another syntax to insert '' in an integer field.
> With POSTGRESQL 803
>
> What I do not understand is why, when I "/i dump.txt" the data from my 7.2
> dump
> All the void integers '' where set correctly.

What do you mean? In 7.2 there is no integer displayed as '', only 0
and NULL. That '' used to convert to zero is *wrong* and won't be
changed back, sorry...

> Now at run time impossible to insert a void integer.

What is a "void integer"? You have either NULL or 0, there have never
been any other choices.

> For the moment I have modified all the application to convert void to zero
> prior to insert/update
>
> This is NOT the expected behavior, but, I am forced to, to preserve run
> time.

This *is* expected behaviour, an empty string is not zero, end of
story.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Вложения

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

Предыдущее
От: Danny Gaethofs
Дата:
Сообщение: Re: Postgres under Windows
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT