Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vsrBr-004iyI-2V for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Feb 2026 23:42:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vsrBq-000zwE-1v for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Feb 2026 23:42:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vsrBq-000zw5-14 for pgsql-hackers@lists.postgresql.org; Wed, 18 Feb 2026 23:42:42 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vsrBl-000000003NQ-3D4F for pgsql-hackers@lists.postgresql.org; Wed, 18 Feb 2026 23:42:42 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 61INgbAr2287787 for ; Wed, 18 Feb 2026 18:42:37 -0500 From: Tom Lane To: pgsql-hackers@lists.postgresql.org Subject: @remove-line-for-nolocal@ is dead code MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <2287755.1771458139.0@sss.pgh.pa.us> Date: Wed, 18 Feb 2026 18:42:37 -0500 Message-ID: <2287786.1771458157@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2287755.1771458139.1@sss.pgh.pa.us> While poking at something else, I noticed that the logic in initdb about removing "@remove-line-for-nolocal@" from pg_hba.conf is useless. Since commit f55808828, it's applied unconditionally; so we might as well just edit that out of pg_hba.conf.sample and delete the code to do so during initdb. This won't save any interesting number of cycles of course, but I think it's confusing to have that decoration in pg_hba.conf.sample when it doesn't do anything. Any objection to the attached? regards, tom lane ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="0001-remove-dead-code-for-nolocal.patch"; charset="us-ascii" Content-ID: <2287755.1771458139.2@sss.pgh.pa.us> Content-Description: 0001-remove-dead-code-for-nolocal.patch Content-Transfer-Encoding: quoted-printable diff --git a/src/backend/libpq/pg_hba.conf.sample b/src/backend/libpq/pg_h= ba.conf.sample index b64c8dea97c..475100f8865 100644 --- a/src/backend/libpq/pg_hba.conf.sample +++ b/src/backend/libpq/pg_hba.conf.sample @@ -109,14 +109,14 @@ = # 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 @authmeth= odlocal@ # IPv4 local connections: host all all 127.0.0.1/32 @authmeth= odhost@ # IPv6 local connections: host all all ::1/128 @authmeth= odhost@ # Allow replication connections from localhost, by a user with the # replication privilege. -@remove-line-for-nolocal@local replication all = @authmethodlocal@ +local replication all @authmeth= odlocal@ host replication all 127.0.0.1/32 @authmeth= odhost@ host replication all ::1/128 @authmeth= odhost@ diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index a3980e5535f..7c49dd433a7 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -1463,9 +1463,6 @@ setup_config(void) = conflines =3D readfile(hba_file); = - conflines =3D 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 ------- =_aaaaaaaaaa0--