Re: Allow disabling folding of unquoted identifiers to lowercase - Mailing list pgsql-general

From John McKown
Subject Re: Allow disabling folding of unquoted identifiers to lowercase
Date
Msg-id CAAJSdjjW=1bZoifUpD1kY0i8AO6AskMa88UizyZnmNUmGm+PwA@mail.gmail.com
Whole thread Raw
In response to Re: Allow disabling folding of unquoted identifiers to lowercase  (John R Pierce <pierce@hogranch.com>)
List pgsql-general
On Fri, Apr 29, 2016 at 3:38 PM, John R Pierce <pierce@hogranch.com> wrote:
On 4/29/2016 12:56 PM, John McKown wrote:

I suspect this would be painful for the parser, unless you also enforced that all SQL keywords were in a specific case (all lower would be the minimal impact to the code).   otherwise the parser would have to lower() every token to check to see if its a keyword, but if not, revert it to its original case.


​ Why? PostgreSQL is written in C. So use strncasecmp() instead of strncmp() or strcasecmp() instead of strcmp() to test for a token.

are those the APIs the parser uses?

​Ah. Good point. I ASSuMEd that what any C language program would use. IIRC, PostgreSQL uses Bison and Flex to generate the parsing grammars, and I don't know what those products output.​

 


-- 
john r pierce, recycling bits in santa cruz



--
The unfacts, did we have them, are too imprecisely few to warrant our certitude.

Maranatha! <><
John McKown

pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: Allow disabling folding of unquoted identifiers to lowercase
Next
From: John McKown
Date:
Subject: Re: Allow disabling folding of unquoted identifiers to lowercase