Non-decimal integer literals - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Non-decimal integer literals
Date
Msg-id b239564c-cad0-b23e-c57e-166d883cb97d@enterprisedb.com
Whole thread Raw
Responses Re: Non-decimal integer literals  (John Naylor <john.naylor@enterprisedb.com>)
Re: Non-decimal integer literals  (Vik Fearing <vik@postgresfriends.org>)
Re: Non-decimal integer literals  (Christoph Berg <myon@debian.org>)
List pgsql-hackers
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.

Those core parts are straightforward enough, but there are a bunch of 
other places where integers are parsed, and one could consider in each 
case whether they should get the same treatment, for example the 
replication syntax lexer, or input function for oid, numeric, and 
int2vector.  There are also some opportunities to move some code around, 
for example scanint8() could be in numutils.c.  I have also looked with 
some suspicion at some details of the number lexing in ecpg, but haven't 
found anything I could break yet.  Suggestions are welcome.

Attachment

pgsql-hackers by date:

Previous
From: Wenjing
Date:
Subject: Is it worth pushing conditions to sublink/subplan?
Next
From: Michael Meskes
Date:
Subject: Re: ECPG bug fix: DECALRE STATEMENT and DEALLOCATE, DESCRIBE