Subject: Re: Clean up hba.c of code freeing regexps

From: Alvaro Herrera <[email-masked]>
Date: Thu, 13 Apr 2023 11:58:51 +0200

On 2023-Apr-13, Michael Paquier wrote:

> With db4f21e in place, there is no need to worry about explicitely
> freeing any regular expressions that may have been compiled when
> loading HBA or ident files because MemoryContextDelete() would be
> able to take care of that now that these are palloc'd (the definitions
> in regcustom.h superseed the ones of regguts.h).

Hmm, nice.

> The logic in hba.c that scans all the HBA and ident lines to any
> regexps can be simplified a lot.  Most of this code is new in 16~, so
> I think that it is worth cleaning up this stuff now rather than wait
> for 17 to open for business.  Still, this is optional, and I don't
> mind waiting for 17 if the regexp/palloc business proves to be an
> issue during beta.

I agree with the downthread votes to clean this up now rather than
waiting.  Also, you're adding exactly zero lines of new code, so I don't
think feature freeze affects the decision.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/
"Once again, thank you and all of the developers for your hard work on
PostgreSQL.  This is by far the most pleasant management experience of
any database I've worked on."                             (Dan Harris)
http://archives.postgresql.org/pgsql-performance/2006-04/msg00247.php