Re: pgsql 10.19 : "ERROR: cannot convert infinity to numeric" except there is no infinity

Поиск
Список
Период
Сортировка
От Achilleas Mantzios
Тема Re: pgsql 10.19 : "ERROR: cannot convert infinity to numeric" except there is no infinity
Дата
Msg-id eef1d4de-3933-fe03-8e06-12a075a163ae@matrix.gatewaynet.com
обсуждение исходный текст
Ответ на Re: pgsql 10.19 : "ERROR: cannot convert infinity to numeric" except there is no infinity  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: pgsql 10.19 : "ERROR: cannot convert infinity to numeric" except there is no infinity  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general

Thanks David

Στις 19/7/22 17:19, ο/η David G. Johnston έγραψε:
On Tuesday, July 19, 2022, Achilleas Mantzios <achill@matrix.gatewaynet.com> wrote:

ERROR:  cannot convert infinity to numeric

-- has no problem testing against infinity

select it.id ,cept.value::numeric as val, numrange(ceptl.min_alarm::numeric,ceptl.max_alarm::numeric
,'()') as range from items it, cept_report cept , dynacom.vessels vsl, machdefs md, cept_reportlimits ceptl wh
ere it.id=cept.id AND md.defid=ceptl.defid AND it.defid=md.defid AND it.vslwhid=vsl.id AND vsl.vslstatus='Acti
ve' and md.application = 'Critical Equipment Performance Test' AND cept.systemdate>= (now()-'1 year'::interval
) AND  cept.value='inf' ORDER BY 1;             
id | val | range  
----+-----+-------
(0 rows)


The column cept.value contains an infinity.  I see nothing unusual in any of these queries given that fact.  If you try to cast the infinity to numeric it will fail.  If that doesn’t happen the query won’t fail.

Sorry I must have been dizzy today with so much support.

Yep, there are some infinity in there, but not in this result set.

I think when the casting is in the WHERE filter for some reason some subplan uses this filter (and fails). But when this check is applied to the result, no infinity is found and works correctly.


David J.

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: postgis
Следующее
От: Achilleas Mantzios
Дата:
Сообщение: Re: pgsql 10.19 : "ERROR: cannot convert infinity to numeric" except there is no infinity