pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vik Fearing <vik@postgresfriends.org>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Non-decimal integer literals
Date: Wed, 8 Sep 2021 14:44:45 +0200
Message-ID: <abb04ce4-a6b8-1c95-fa16-dc87e851e106@postgresfriends.org> (raw)
In-Reply-To: <b239564c-cad0-b23e-c57e-166d883cb97d@enterprisedb.com>
References: <b239564c-cad0-b23e-c57e-166d883cb97d@enterprisedb.com>

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.

(The standard does not allow identifiers to begin with _ but we do...)
-- 
Vik Fearing





view thread (62+ messages)  latest in thread

Message-ID: <abb04ce4-a6b8-1c95-fa16-dc87e851e106@postgresfriends.org>
Permalink:  ../abb04ce4-a6b8-1c95-fa16-dc87e851e106@postgresfriends.org/
Also on:    postgresql.org/message-id/abb04ce4-a6b8-1c95-fa16-dc87e851e106@postgresfriends.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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: vik@postgresfriends.org, peter.eisentraut@enterprisedb.com
  Subject: Re: Non-decimal integer literals
  In-Reply-To: <abb04ce4-a6b8-1c95-fa16-dc87e851e106@postgresfriends.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