Re: Keywords in pg_hba.conf should be field-specific

From: Brendan Jurd <direvus(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Keywords in pg_hba.conf should be field-specific
Date: 2010-10-16 16:07:13
Message-ID: AANLkTi=heyzyVKFqAYwCAZfvcVVdpT_fUm20p-Xm7XOK@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 17 October 2010 02:27, Alvaro Herrera <alvherre(at)commandprompt(dot)com> wrote:
> Hmm.  Would it be possible to list keywords _applicable_ to each field,
> and have these passed down to next_token by the caller instead?  This
> seems backwards, but I'm not sure if the other way is really workable.
>

Short answer: I don't think it is workable, or I would have done it
that way in the first place.

Full answer: The problem is that pg_hba.conf doesn't have a fixed
structure. Each line can be 4, 5 or 6 fields (not including the final
'options' field) long, and which of these structures apply to any
given line isn't decided until parse_hba_line goes to work on it.

At the time that next_token gets called, we have no way of knowing
which field is currently being tokenised, at least not without doing
some serious rearrangement of hba.c, so that it tokenises and then
parses one token at a time, instead of tokenising the whole file and
then parsing all the lines.

Cheers,
BJ

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Paul Ramsey 2010-10-16 16:23:36 Re: knngist - 0.8
Previous Message Bernd Helmle 2010-10-16 16:05:54 Re: Trailing Whitespace Tips (was: Re: starting to review the Extend NOT NULL representation to pg_constraint patch)