Re: Null vs. Empty String in Postgres 8.3.8

Поиск
Список
Период
Сортировка
От Wang, Mary Y
Тема Re: Null vs. Empty String in Postgres 8.3.8
Дата
Msg-id FA20D4C4FEBFD148B1C0CB09913825FC0457D936AA@XCH-SW-06V.sw.nos.boeing.com
обсуждение исходный текст
Ответ на Re: Null vs. Empty String in Postgres 8.3.8  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Null vs. Empty String in Postgres 8.3.8  (Scott Marlowe <scott.marlowe@gmail.com>)
Re: Null vs. Empty String in Postgres 8.3.8  (CaT <cat@zip.com.au>)
Список pgsql-general
I still don't get it.  I do want a zero for the subversion_flags to be stored in the table.  But it returned an error
becauseit didn't like subversion_flags='' in the UPDATE SQL statement.   

subversion_flags | integer       | not null default 0

Mary


-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Sunday, April 04, 2010 7:50 PM
To: Wang, Mary Y
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Null vs. Empty String in Postgres 8.3.8

"Wang, Mary Y" <mary.y.wang@boeing.com> writes:
> Can someone provide a link to the Postgres 8.x documentation that provides information about Null vs. Empty String?
> Here is the situation:
> Currently,  the source code performs the following SQL statement :
> UPDATE user_group set subversion_flags='' WHERE user_id='5818' AND
> group_id='438'; (This SQL statement worked in a very old version of
> Postgres) and pgsql 8.3.8 returned ERROR:  invalid input syntax for integer: ""

You were not getting a NULL there.  You were getting an integer zero, as a result of sloppy input checking in the
integer-inputroutine. 

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Null vs. Empty String in Postgres 8.3.8
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Null vs. Empty String in Postgres 8.3.8