Re: Fwd: Keywords in pg_hba.conf should be field-specific - Mailing list pgsql-hackers

From Brendan Jurd
Subject Re: Fwd: Keywords in pg_hba.conf should be field-specific
Date
Msg-id BANLkTikpEkpGYfEAjcn2=q9ns-Z4HiveRg@mail.gmail.com
Whole thread Raw
In response to Re: Fwd: Keywords in pg_hba.conf should be field-specific  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: Fwd: Keywords in pg_hba.conf should be field-specific
List pgsql-hackers
On 21 June 2011 14:34, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> I don't understand to using a macro
>
> #define token_is_keyword(t, k)  (!t->quoted && strcmp(t->string, k) == 0)
>
> because you disallowed a quoting?

Well, a token can only be treated as a special keyword if it is unquoted.

As an example, in the 'database' field, the bare token 'replication'
is a keyword meaning the pseudo-database for streaming rep.  Whereas
the quoted token "replication" would mean a real database which is
called 'replication'.

Likewise, the bare token 'all' in the username field is a keyword --
it matches any username.  Whereas the quoted token "all" would only
match a user named 'all'.

Therefore, token_is_keyword only returns true where the token matches
the given string as is also unquoted.

Does that make sense?

Cheers,
BJ


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Fwd: Keywords in pg_hba.conf should be field-specific
Next
From: Jesper Krogh
Date:
Subject: Re: FOR KEY LOCK foreign keys