Re: Non-decimal integer literals
| От | Tom Lane |
|---|---|
| Тема | Re: Non-decimal integer literals |
| Дата | |
| Msg-id | 3260805.1631106874@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Non-decimal integer literals (Vik Fearing <vik@postgresfriends.org>) |
| Ответы |
Re: Non-decimal integer literals
|
| Список | pgsql-hackers |
Vik Fearing <vik@postgresfriends.org> writes:
> On 8/16/21 11:51 AM, Peter Eisentraut wrote:
>> Here is a patch to add support for hexadecimal, octal, and binary
>> integer literals:
>>
>> 0x42E
>> 0o112
>> 0b100101
>>
>> per SQL:202x draft.
> Is there any hope of adding the optional underscores? I see a potential
> problem there as SELECT 1_a; is currently parsed as SELECT 1 AS _a; when
> it should be parsed as SELECT 1_ AS a; or perhaps even as an error since
> 0x1_a would be a valid number with no alias.
Even without that point, this patch *is* going to break valid queries,
because every one of those cases is a valid number-followed-by-identifier
today, e.g.
regression=# select 0x42e;
x42e
------
0
(1 row)
AFAIR we've seen exactly zero field demand for this feature,
so I kind of wonder why we're in such a hurry to adopt something
that hasn't even made it past draft-standard status.
regards, tom lane
В списке pgsql-hackers по дате отправления: