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 1kdfUu-0002jZ-5A for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Nov 2020 20:16:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kdfUt-0003T8-1Y for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Nov 2020 20:16:39 +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 1kdfUs-0003T1-Qr for pgsql-hackers@lists.postgresql.org; Fri, 13 Nov 2020 20:16:38 +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 1kdfUq-0008LA-SN for pgsql-hackers@postgresql.org; Fri, 13 Nov 2020 20:16:38 +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 0ADKGDe2396838; Fri, 13 Nov 2020 15:16:13 -0500 From: Tom Lane To: Alexander Lakhin cc: Justin Pryzby , Fabien COELHO , pgsql-hackers@postgresql.org, Alvaro Herrera , David Steele , "Bossart, Nathan" , Thomas Munro Subject: Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction In-reply-to: <83048c77-2531-48cb-aa2b-aa01cc5af519@gmail.com> References: <24244.1585415634@sss.pgh.pa.us> <20200328183904.GI20103@telsasoft.com> <28906.1585422475@sss.pgh.pa.us> <27064.1585499825@sss.pgh.pa.us> <20200329171415.GL20103@telsasoft.com> <29512.1585502524@sss.pgh.pa.us> <20200329201215.GM20103@telsasoft.com> <4028.1585579463@sss.pgh.pa.us> <20200331080643.GE14618@telsasoft.com> <11882.1585672910@sss.pgh.pa.us> <83048c77-2531-48cb-aa2b-aa01cc5af519@gmail.com> Comments: In-reply-to Alexander Lakhin message dated "Fri, 13 Nov 2020 23:00:00 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <396836.1605298573.1@sss.pgh.pa.us> Date: Fri, 13 Nov 2020 15:16:13 -0500 Message-ID: <396837.1605298573@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alexander Lakhin writes: > Shouldn't pg_ls_dir_files() retry stat() on ERROR_ACCESS_DENIED just > like the pgwin32_open() does to ignore files in "delete pending" state? That would soon lead us to changing every stat() caller in the system to have Windows-specific looping logic. No thanks. If we need to do this, let's put in a Windows wrapper layer comparable to pgwin32_open() for open(). regards, tom lane