Re: [TODO] Process pg_hba.conf keywords as case-insensitive

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: cb(at)df7cb(dot)de
Cc: hlinnakangas(at)vmware(dot)com, viswanatham(dot)kirankumar(at)huawei(dot)com, tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [TODO] Process pg_hba.conf keywords as case-insensitive
Date: 2014-09-09 11:49:30
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello, I will be the reviewer of this patch.

You approach that coloring tokens seems right, but you have
broken the parse logic by adding your code.

Other than the mistakes others pointed, I found that

- non-SQL-ident like tokens are ignored by their token style,
quoted or not, so the following line works.

| "local" All aLL trust

I suppose this is not what you intended. This is because you have
igonred the attribute of a token when comparing it as
non-SQL-ident tokens.

- '+' at the head of the sequence '+"' is treated as the first
character of the *quoted* string. e.g. +"hoge" is tokenized as

This is why you simply continued processing for '+"' without
discarding and skipping the '+', and not setting in_quote so the
following parser code works as it is not intended. You should
understand what the original code does and insert or modify
logics not braeking the assumptions.

> > With this patch, database (and role?) names are compared case-insensitively.
> > For example:
> >
> > local MixedDB all trust
> > local mixedDB all reject
> >
> > psql -d "mixedDB"
> > psql (9.5devel)
> > Type "help" for help.
> >
> > mixedDB=#
> >
> > That connection should've matched that 2nd line, and be rejected.
> Actually it should have matched neither, as both lines will get folded
> downcase:
> local mixeddb all trust
> local mixeddb all reject


Kyotaro Horiguchi
NTT Open Source Software Center

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message didier 2014-09-09 12:07:55 Re: posix_fadvise() and pg_receivexlog
Previous Message Heikki Linnakangas 2014-09-09 11:49:17 Re: BRIN indexes (was Re: Minmax indexes)