pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Non-decimal integer literals
Date: Wed, 14 Dec 2022 05:31:41 +0000
Message-ID: <E1p5KMm-003Uhn-Nb@gemulon.postgresql.org> (raw)

Non-decimal integer literals

Add support for hexadecimal, octal, and binary integer literals:

    0x42F
    0o273
    0b100101

per SQL:202x draft.

This adds support in the lexer as well as in the integer type input
functions.

Reviewed-by: John Naylor <john.naylor@enterprisedb.com>
Reviewed-by: Zhihong Yu <zyu@yugabyte.com>
Reviewed-by: David Rowley <dgrowleyml@gmail.com>
Reviewed-by: Dean Rasheed <dean.a.rasheed@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/b239564c-cad0-b23e-c57e-166d883cb97d@enterprisedb.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6fcda9aba83449082124825b6d375c0a61e21c42

Modified Files
--------------
doc/src/sgml/syntax.sgml                   |  34 +++++
src/backend/catalog/information_schema.sql |   6 +-
src/backend/catalog/sql_features.txt       |   1 +
src/backend/parser/parse_node.c            |  37 +++++-
src/backend/parser/scan.l                  | 101 +++++++++++----
src/backend/utils/adt/numutils.c           | 185 +++++++++++++++++++++++----
src/fe_utils/psqlscan.l                    |  78 +++++++++---
src/interfaces/ecpg/preproc/pgc.l          | 106 +++++++++-------
src/test/regress/expected/int2.out         |  92 ++++++++++++++
src/test/regress/expected/int4.out         |  92 ++++++++++++++
src/test/regress/expected/int8.out         |  92 ++++++++++++++
src/test/regress/expected/numerology.out   | 193 ++++++++++++++++++++++++++++-
src/test/regress/sql/int2.sql              |  26 ++++
src/test/regress/sql/int4.sql              |  26 ++++
src/test/regress/sql/int8.sql              |  26 ++++
src/test/regress/sql/numerology.sql        |  51 +++++++-
16 files changed, 1028 insertions(+), 118 deletions(-)



Message-ID: <E1p5KMm-003Uhn-Nb@gemulon.postgresql.org>
Permalink:  ../E1p5KMm-003Uhn-Nb@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1p5KMm-003Uhn-Nb@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org
  Subject: Re: pgsql: Non-decimal integer literals
  In-Reply-To: <E1p5KMm-003Uhn-Nb@gemulon.postgresql.org>
  References: <E1p5KMm-003Uhn-Nb@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox