Re: trailing junk in numeric literals

2021-01-16 Thread Tom Lane
Vik Fearing writes: > With respect, you are looking at a 10-year-old document and I am not. > 5.3 has since been modified. Is a newer version of the spec available online? regards, tom lane

Re: trailing junk in numeric literals

2021-01-16 Thread Vik Fearing
On 1/16/21 6:10 PM, Tom Lane wrote: > Vik Fearing writes: >> On 1/16/21 4:32 PM, Andreas Karlsson wrote: >>> On 1/16/21 2:02 PM, Vik Fearing wrote: I am in favor of such a change so that we can also accept 1_000_000 which currently parses as "1 AS _000_000" (which also isn't compliant >>

Re: trailing junk in numeric literals

2021-01-16 Thread Tom Lane
Vik Fearing writes: > On 1/16/21 4:32 PM, Andreas Karlsson wrote: >> On 1/16/21 2:02 PM, Vik Fearing wrote: >>> I am in favor of such a change so that we can also accept 1_000_000 >>> which currently parses as "1 AS _000_000" (which also isn't compliant >>> because identifiers cannot start with an

Re: trailing junk in numeric literals

2021-01-16 Thread Vik Fearing
On 1/16/21 4:32 PM, Andreas Karlsson wrote: > On 1/16/21 2:02 PM, Vik Fearing wrote: >> I am in favor of such a change so that we can also accept 1_000_000 >> which currently parses as "1 AS _000_000" (which also isn't compliant >> because identifiers cannot start with an underscore, but I don't wa

Re: trailing junk in numeric literals

2021-01-16 Thread Andreas Karlsson
On 1/16/21 2:02 PM, Vik Fearing wrote: I am in favor of such a change so that we can also accept 1_000_000 which currently parses as "1 AS _000_000" (which also isn't compliant because identifiers cannot start with an underscore, but I don't want to take it that far). It would also allow us to h

Re: trailing junk in numeric literals

2021-01-16 Thread Vik Fearing
On 12/29/20 10:18 AM, Peter Eisentraut wrote: > On 2020-12-28 21:54, Tom Lane wrote: >> Peter Eisentraut writes: >>> I was surprised to find that this doesn't error: >>> => select 100a; >>>     a >>> - >>>    100 >> >>> I suspect this and similar cases used to error before aliases without AS >

Re: trailing junk in numeric literals

2020-12-29 Thread Fabien COELHO
Hello Peter, My 0.02€: So strictly speaking this SQL code is nonstandard anyway. But our lexer has always been forgiving about not requiring space if it's not logically necessary to separate tokens. I doubt trying to change that would improve matters. Well, the idea is to diagnose potentia

Re: trailing junk in numeric literals

2020-12-29 Thread Peter Eisentraut
On 2020-12-28 21:54, Tom Lane wrote: Peter Eisentraut writes: I was surprised to find that this doesn't error: => select 100a; a - 100 I suspect this and similar cases used to error before aliases without AS were introduced. But now this seems possibly problematic. Should we try

Re: trailing junk in numeric literals

2020-12-28 Thread Tom Lane
Peter Eisentraut writes: > I was surprised to find that this doesn't error: > => select 100a; >a > - > 100 > I suspect this and similar cases used to error before aliases without AS > were introduced. But now this seems possibly problematic. Should we > try to handle this better? M