]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Remove no-longer-useful markers in pg_hba.conf.sample.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 19 Feb 2026 16:08:52 +0000 (11:08 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 19 Feb 2026 16:09:00 +0000 (11:09 -0500)
The source version of pg_hba.conf.sample contains
@remove-line-for-nolocal@ markers that indicate which lines should
be deleted for an installation that doesn't HAVE_UNIX_SOCKETS.
We no longer support that case, and since commit f55808828 all
that initdb is doing is unconditionally removing the markers.
We might as well remove the markers from the source version and
drop the removal code, which is unintelligible now anyway.

This will not of course save any noticeable number of cycles
in initdb, but it might save some confusion for future
developers looking at pg_hba.conf.sample.  It also reduces the
number of distinct cases that replace_token() has to support,
possibly allowing some tightening of that function.

Discussion: https://postgr.es/m/2287786.1771458157@sss.pgh.pa.us

src/backend/libpq/pg_hba.conf.sample
src/bin/initdb/initdb.c

index b64c8dea97c3138822cd9bc4dbc35b71718f1138..475100f88653ba99a916595fc4ca4eda51f47406 100644 (file)
 
 # TYPE  DATABASE        USER            ADDRESS                 METHOD
 
-@remove-line-for-nolocal@# "local" is for Unix domain socket connections only
-@remove-line-for-nolocal@local   all             all                                     @authmethodlocal@
+# "local" is for Unix domain socket connections only
+local   all             all                                     @authmethodlocal@
 # IPv4 local connections:
 host    all             all             127.0.0.1/32            @authmethodhost@
 # IPv6 local connections:
 host    all             all             ::1/128                 @authmethodhost@
 # Allow replication connections from localhost, by a user with the
 # replication privilege.
-@remove-line-for-nolocal@local   replication     all                                     @authmethodlocal@
+local   replication     all                                     @authmethodlocal@
 host    replication     all             127.0.0.1/32            @authmethodhost@
 host    replication     all             ::1/128                 @authmethodhost@
index a3980e5535f05137a96382fe27d5693a3c280a33..7c49dd433a70c73ec002ebf1fa003e68ce38e2d7 100644 (file)
@@ -1463,9 +1463,6 @@ setup_config(void)
 
        conflines = readfile(hba_file);
 
-       conflines = replace_token(conflines, "@remove-line-for-nolocal@", "");
-
-
        /*
         * Probe to see if there is really any platform support for IPv6, and
         * comment out the relevant pg_hba line if not.  This avoids runtime