Re: [HACKERS] T_Float morph to T_Integer after nodeRead

Поиск
Список
Период
Сортировка
От Kouhei Kaigai
Тема Re: [HACKERS] T_Float morph to T_Integer after nodeRead
Дата
Msg-id 9A28C8860F777E439AA12E8AEA7694F801281DC7@BPXM15GP.gisp.nec.co.jp
обсуждение исходный текст
Ответ на Re: [HACKERS] T_Float morph to T_Integer after nodeRead  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> Kouhei Kaigai <kaigai@ak.jp.nec.com> writes:
> > Simplified description of what I did is:
> >   fval = makeFloat(psprintf("%.0f", plan_nrows));
> >   custom_scan->custom_private = list_make1(fval);
>
> So don't do that.  The lexer would never produce T_Float for an
> integer-looking string, so I think it's out of scope for nodeRead() to be
> able to reconstitute such a thing.  You could use %.1f, perhaps.
> But actually, if you're worried about reconstituting exactly what you had,
> aren't you risking precision loss anyway?  Maybe something like
> psprintf("%.*e", DBL_DIG+3, plan_nrows) would be safer.
>
Ah, indeed, it is a good idea to avoid the problem.

Thanks,
----
PG-Strom Project / NEC OSS Promotion Center
KaiGai Kohei <kaigai@ak.jp.nec.com>




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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Indirect indexes
Следующее
От: Vitaly Burovoy
Дата:
Сообщение: Re: [HACKERS] Re: [BUGS][PATCH] BUG #14486: Inserting and selectinginterval have different constraints