Skip site navigation (1) Skip section navigation (2)

pgsql: Parse pg_ident.conf when it's loaded,keeping it in memory in pa

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Parse pg_ident.conf when it's loaded,keeping it in memory in pa
Date: 2012-09-21 14:59:00
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-committers
Parse pg_ident.conf when it's loaded, keeping it in memory in parsed format.

Similar changes were done to pg_hba.conf earlier already, this commit makes
pg_ident.conf to behave the same as pg_hba.conf.

This has two user-visible effects. First, if pg_ident.conf contains multiple
errors, the whole file is parsed at postmaster startup time and all the
errors are immediately reported. Before this patch, the file was parsed and
the errors were reported only when someone tries to connect using an
authentication method that uses the file, and the parsing stopped on first
error. Second, if you SIGHUP to reload the config files, and the new
pg_ident.conf file contains an error, the error is logged but the old file
stays in effect.

Also, regular expressions in pg_ident.conf are now compiled only once when
the file is loaded, rather than every time the a user is authenticated. That
should speed up authentication if you have a lot of regexps in the file.

Amit Kapila



Modified Files
src/backend/libpq/hba.c             |  268 +++++++++++++++++++++++------------
src/backend/postmaster/postmaster.c |   15 ++-
src/backend/utils/init/postinit.c   |   11 ++-
src/include/libpq/hba.h             |   13 ++-
4 files changed, 213 insertions(+), 94 deletions(-)

pgsql-committers by date

Next:From: User KarlDate: 2012-09-21 16:44:29
Subject: pgtcl - libpgtcl: Update the postgresql database schema comparator.
Previous:From: Andres FreundDate: 2012-09-21 14:41:12
Subject: Re: [COMMITTERS] pgsql: Properly set relpersistence for fake relcache entries.

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group