Re: BUG #8355: PL/Python 3 can't convert infinity to PostgreSQL's value

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: grv87(at)yandex(dot)ru
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #8355: PL/Python 3 can't convert infinity to PostgreSQL's value
Date: 2013-08-03 16:47:14
Message-ID: 4679.1375548434@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I wrote:
> ... But it seems like maybe we had better cover the
> following cases that we do not cover today:

> inf
> +inf
> -inf
> +Infinity

I've committed a patch that makes sure float4in and float8in accept
these spellings even when the underlying strtod(3) function does not.
However, it turns out that this doesn't fix your test case on my HPUX
box, and I'm betting that it won't help on Windows either, because
it's actually Python that's failing. You can reproduce the failure
without any Postgres code involved at all:

$ python
Python 2.5.1 (r251:54863, Jul 12 2007, 23:25:33)
[GCC 2.95.3 20010315 (release)] on hp-ux10
Type "help", "copyright", "credits" or "license" for more information.
>>> a = float('inf')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: invalid literal for float(): inf

Now, I seriously doubt that the Python guys will give a darn about
a 15-year-old version of HPUX, but if you can reproduce the above
on your Windows machine, I'd suggest filing a bug about it with them.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message jbglaw 2013-08-04 02:00:42 BUG #8361: 9.3~beta2-2: Wrong `interval' format with aggregate functions.
Previous Message Bruce Momjian 2013-08-03 03:47:03 Re: 9.3beta2: Failure to pg_upgrade