Re: Problem with reloading groups in pg_hba.conf

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Ross J(dot) Reedstrom" <reedstrm(at)rice(dot)edu>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Problem with reloading groups in pg_hba.conf
Date: 2002-03-21 16:52:04
Message-ID: 200203211652.g2LGq4k29476@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ross J. Reedstrom wrote:
> On Thu, Mar 21, 2002 at 11:38:05AM -0500, Bruce Momjian wrote:
> >
> > I am handling it like pg_shadow. The problem is that because I expand
> > pg_group inside the pg_hba tokens, I have to retokenize pg_hba.conf too
> > after pg_group changes. I assumed we didn't want pg_hba.conf
> > retokenized on a password change and only on a pg_ctl reload.
> >
> > My new code has a separate pg_group token list which is not expanded
> > into the pg_hba.conf token list and is traversed for every connection.
>
> Hmm, your trading performance on every connection for less work on the
> rare event of a password change? What's wrong with reparsing pg_hba.conf
> at password/group change? Streamline the common case, don't optimize for
> the rare condition.

Yes, that was the issue. We tell people pg_hba.conf only gets reloaded
when they tell the postmaster to do it. We can't have it happening at
random times, e.g. password change. My new coding will need to only
spin through a list of group names, not the list of users in each group.
That's why the new format for global/pg_group should make things ok for
doing this at connection time.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-03-21 17:02:13 Re: Problem with reloading groups in pg_hba.conf
Previous Message Ross J. Reedstrom 2002-03-21 16:49:16 Re: Problem with reloading groups in pg_hba.conf