Re: Underscores in numeric literals

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Underscores in numeric literals
Дата
Msg-id 4015800.1672152932@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Underscores in numeric literals  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Ответы Re: Underscores in numeric literals  (Justin Pryzby <pryzby@telsasoft.com>)
Re: Underscores in numeric literals  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:
> Here is a patch to add support for underscores in numeric literals, for 
> visual grouping, like

>      1_500_000_000
>      0b10001000_00000000
>      0o_1_755
>      0xFFFF_FFFF
>      1.618_034

> per SQL:202x draft.

> This adds support in the lexer as well as in the integer type input 
> functions.
> TODO: float/numeric type input support

Hmm ... I'm on board with allowing this in SQL if the committee says
so.  I'm not especially on board with accepting it in datatype input
functions.  There's been zero demand for that AFAIR.  Moreover,
I don't think we need the inevitable I/O performance hit, nor the
increased risk of accepting garbage, nor the certainty of
inconsistency with other places that don't get converted (because
they depend on strtoul() or whatever).

We already accept that numeric input is different from numeric
literals: you can't write Infinity or NaN in SQL without quotes.
So I don't see an argument that we have to allow this in numeric
input for consistency.

            regards, tom lane



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

Предыдущее
От: "Anton A. Melnikov"
Дата:
Сообщение: Re: [BUG] pg_upgrade test fails from older versions.
Следующее
От: Justin Pryzby
Дата:
Сообщение: Re: Underscores in numeric literals