Re: Non-decimal integer literals - Mailing list pgsql-hackers

From John Naylor
Subject Re: Non-decimal integer literals
Date
Msg-id CAFBsxsHZZ4e7CaFQoAY=GZiUDcXpjEOXq5R86mok5S_wYyvbbQ@mail.gmail.com
Whole thread Raw
In response to Non-decimal integer literals  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Responses Re: Non-decimal integer literals
List pgsql-hackers

On Mon, Aug 16, 2021 at 5:52 AM Peter Eisentraut <peter.eisentraut@enterprisedb.com> wrote:
>
> Here is a patch to add support for hexadecimal, octal, and binary
> integer literals:
>
>      0x42E
>      0o112
>      0b100101
>
> per SQL:202x draft.
>
> This adds support in the lexer as well as in the integer type input
> functions.

The one thing that jumped out at me on a cursory reading is the {integer} rule, which seems to be used nowhere except to call process_integer_literal, which must then inspect the token text to figure out what type of integer it is. Maybe consider 4 separate process_*_literal functions?

--
John Naylor
EDB: http://www.enterprisedb.com

pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: badly calculated width of emoji in psql
Next
From: Tomas Vondra
Date:
Subject: Re: PoC/WIP: Extended statistics on expressions