Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1klEoC-0005Qw-GB for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Dec 2020 17:23:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1klEoB-0003uP-Ea for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Dec 2020 17:23:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1klEoB-0003uH-7Q for pgsql-hackers@lists.postgresql.org; Fri, 04 Dec 2020 17:23:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1klEo9-0003wT-4q for pgsql-hackers@postgresql.org; Fri, 04 Dec 2020 17:23:50 +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 0B4HNNvH2168894; Fri, 4 Dec 2020 12:23:23 -0500 From: Tom Lane To: Justin Pryzby cc: Fabien COELHO , Alvaro Herrera , David Steele , pgsql-hackers@postgresql.org, "Bossart, Nathan" , Thomas Munro Subject: Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*) In-reply-to: <20201129172115.GO24052@telsasoft.com> References: <20200503024215.GJ28974@telsasoft.com> <20200526021003.GW4472@telsasoft.com> <20200622015325.GG17995@telsasoft.com> <20200715030839.GX23581@telsasoft.com> <20200718201532.GV23581@telsasoft.com> <20200908195126.GB18552@telsasoft.com> <20201028193402.GA28528@telsasoft.com> <129225.1606166058@sss.pgh.pa.us> <20201129172115.GO24052@telsasoft.com> Comments: In-reply-to Justin Pryzby message dated "Sun, 29 Nov 2020 11:21:15 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2168892.1607102603.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2020 12:23:23 -0500 Message-ID: <2168893.1607102603@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Justin Pryzby writes: [ v24-0001-Document-historic-behavior-of-links-to-directori.patch ] The cfbot is unhappy with one of the test cases you added: 6245@@ -259,9 +259,11 @@ 6246 select path, filename, type from pg_ls_dir_metadata('.', true, false,= true) where path!~'[0-9]|pg_internal.init|global.tmp' order by 1; 6247 path | filename | type = 6248 ----------------------------------+-----------------------+------ 6249+ PG_VERSION | PG_VERSION | - 6250 base | base | d 6251 base/pgsql_tmp | pgsql_tmp | d 6252 global | global | d 6253+ global/config_exec_params | config_exec_params | - 6254 global/pg_control | pg_control | - 6255 global/pg_filenode.map | pg_filenode.map | - 6256 pg_commit_ts | pg_commit_ts | d 6257@@ -285,7 +287,6 @@ 6258 pg_subtrans | pg_subtrans | d 6259 pg_tblspc | pg_tblspc | d 6260 pg_twophase | pg_twophase | d 6261- PG_VERSION | PG_VERSION | - 6262 pg_wal | pg_wal | d 6263 pg_wal/archive_status | archive_status | d 6264 pg_xact | pg_xact | d 6265@@ -293,7 +294,7 @@ 6266 postgresql.conf | postgresql.conf | - 6267 postmaster.opts | postmaster.opts | - 6268 postmaster.pid | postmaster.pid | - 6269-(34 rows) 6270+(35 rows) This shows that (a) the test is sensitive to prevailing collation and (b) it's not filtering out enough temporary files. Even if those things were fixed, though, the test would break every time we added/removed some PGDATA substructure. Worse, it'd also break if say somebody had edited postgresql.conf and left an editor backup file behind, or when running in an installation where the configuration files are someplace else. I think this is way too fragile to be acceptable. Maybe it could be salvaged by reversing the sense of the WHERE condition so that instead of trying to blacklist stuff, you whitelist just a small number of files that should certainly be there. regards, tom lane