pgsql: Non-decimal integer literals - Mailing list pgsql-committers

From Peter Eisentraut
Subject pgsql: Non-decimal integer literals
Date
Msg-id E1p5KMm-003Uhn-Nb@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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(-)


pgsql-committers by date:

Previous
From: Jeff Davis
Date:
Subject: pgsql: Add grantable MAINTAIN privilege and pg_maintain role.
Next
From: Etsuro Fujita
Date:
Subject: Re: pgsql: postgres_fdw: Fix assertion in estimate_path_cost_size().