Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jIveW-0002kq-OA for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Mar 2020 14:44:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jIveT-0008Fe-QM for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Mar 2020 14:44:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jIveT-0008FW-Gi for pgsql-hackers@lists.postgresql.org; Mon, 30 Mar 2020 14:44:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jIveR-0006O7-Ej for pgsql-hackers@postgresql.org; Mon, 30 Mar 2020 14:44:32 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 02UEiNse004029; Mon, 30 Mar 2020 10:44:23 -0400 From: Tom Lane To: Fabien COELHO cc: Justin Pryzby , 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: References: <20200312121156.GB29065@telsasoft.com> <20200316155306.GM26184@telsasoft.com> <3061.1584409130@sss.pgh.pa.us> <20200317020017.GT26184@telsasoft.com> <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> Comments: In-reply-to Fabien COELHO message dated "Mon, 30 Mar 2020 07:16:17 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4027.1585579463.1@sss.pgh.pa.us> Date: Mon, 30 Mar 2020 10:44:23 -0400 Message-ID: <4028.1585579463@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Fabien COELHO writes: > As I wrote about an earlier version of the patch, ISTM that instead of > reinventing, extending, adapting various ls variants (with/without > metadata, which show only files, which shows target of links, which shows > directory, etc.) we would just need *one* postgres "ls" implementation > which would be like "ls -la arg" (returns file type, dates), and then > everything else is a wrapper around that with appropriate filtering that > can be done at the SQL level, like you started with recurse. Yeah, I agree that some new function that can represent symlinks explicitly in its output is the place to deal with this, for people who want to deal with it. In the meantime, there's still the question of what pg_ls_dir_files should do exactly. Are we content to have it ignore symlinks? I remain inclined to think that's the right thing given its current brief. regards, tom lane