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

From: David Pradier <dpradier(at)apartia(dot)fr>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Error when comparing an integer to an empty string.
Date: 2002-11-22 09:02:42
Message-ID: 20021122090242.GA27817@apartia.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > 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.

It's because it comes from a perl building of the request.
Typically : '$youpee'
When $youpee is undef, it's no problem in 7.2, and the request returns
false.
Now it raises an error.
(Ok, i've understood it was on purpose ; i give these info only for the
background :-)

Best regards,
David

--
dpradier(at)apartia(dot)fr

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Evgen Potemkin 2002-11-22 10:57:40 Hirarchical queries a la Oracle. Patch.
Previous Message Hans-Jürgen Schönig 2002-11-22 08:16:16 Re: Question about DEADLOCK