Peter Eisentraut <[EMAIL PROTECTED]> writes:
> Tom Lane writes:
>> I don't see any clear statement in SQL92 that <delimited identifiers>
>> can't have zero length, so I'm not convinced there's anything wrong here.

> Hmm, I do:

>          <delimited identifier> ::=
>               <double quote> <delimited identifier body> <double quote>
 
>          <delimited identifier body> ::= <delimited identifier part>...
 
>          <delimited identifier part> ::=
>                 <nondoublequote character>
>               | <doublequote symbol>

> As opposed to, say, an empty character string literal:

>          <character string literal> ::=
>               [ <introducer><character set specification> ]
>               <quote> [ <character representation>... ] <quote>
>               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>                 [ { <separator>... <quote> [ <character representation>... ] <quote> 
>}... ] 

Hmm, you're right --- if they meant to allow zero-length identifiers
they'd have written something like

         <delimited identifier> ::=
              <double quote> [ <delimited identifier body> ] <double quote>

I stand corrected.

Next question is do we want to change it?  I can't imagine any real good
use for a null-string name, but is there any risk of breaking existing
applications?

The actual fix would be trivial --- just introduce a complaint for
strlen(literalbuf)==0 into parser/scan.l's <xd>{xdstop} rule.
I'm just wondering if we should change or not.

                        regards, tom lane

Reply via email to