Re: Error when comparing an integer to an empty string.

Поиск
Список
Период
Сортировка
От Louis-David Mitterrand
Тема Re: Error when comparing an integer to an empty string.
Дата
Msg-id 20021121174344.GA4945@apartia.org
обсуждение исходный текст
Ответ на Re: Error when comparing an integer to an empty string.  (Bruno Wolff III <bruno@wolff.to>)
Ответы Re: Error when comparing an integer to an empty string.  (Neil Conway <neilc@samurai.com>)
Re: Error when comparing an integer to an empty string.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Thu, Nov 21, 2002 at 11:07:55AM -0600, Bruno Wolff III wrote:
> On Thu, Nov 21, 2002 at 17:30:10 +0100,
>   David Pradier <dpradier@apartia.fr> wrote:
> > Hi!
> > 
> > I'm new on this list, my name is David Pradier, and i'm french.
> > 
> > I'm currently trying the new postgresql 7.3rc1, and i've noticed that if
> > i compared an integer to an empty string, i ran in an error.
> > 
> > Is this a bug or a feature of the new 7.3 version ?
> > Is there a purpose ?
> 
> What number do you expect '' to represent?
> 
> Probably you either want to use:
> = '0'
> or
> is null
> depending on what you are really trying to do.

The point David was trying to make is: 

with 7.2:
template1=# select 1 = ''; ?column? ---------- f(1 row)


with 7.3rc1:
template1=# select 1 = '';ERROR:  pg_atoi: zero-length string


Is this change of behavior intentional?

-- HIPPOLYTE: Trézène m'obéit. Les campagnes de Crète           Offrent au fils de Phèdre une riche retraite.
                             (Phèdre, J-B Racine, acte 2, scène 2)
 


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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: Error when comparing an integer to an empty string.
Следующее
От: Neil Conway
Дата:
Сообщение: Re: Error when comparing an integer to an empty string.