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 1jJ9ZP-0006Yo-F7 for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Mar 2020 05:36:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jJ9ZO-0006O0-2Q for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Mar 2020 05:36:14 +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 1jJ9ZN-0006Nr-Rg for pgsql-hackers@lists.postgresql.org; Tue, 31 Mar 2020 05:36:13 +0000 Received: from courriel-2.mines-paristech.fr ([77.158.173.19] helo=antispam-1.ensmp.fr) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jJ9ZH-00077E-9v for pgsql-hackers@postgresql.org; Tue, 31 Mar 2020 05:36:13 +0000 Received: from smtp-4.mines-paristech.fr (smtp-4.ensmp.fr [77.158.173.143]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by antispam-1.ensmp.fr (antispam.mines-paristech.fr) with ESMTPS id 547D55643E; Tue, 31 Mar 2020 07:36:05 +0200 (CEST) Received: from pseudo (108.237.219.88.rev.sfr.net [88.219.237.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp-4.mines-paristech.fr (Postfix) with ESMTPSA id CBF112C0057; Tue, 31 Mar 2020 07:36:04 +0200 (CEST) Date: Tue, 31 Mar 2020 07:36:03 +0200 (CEST) From: Fabien COELHO X-X-Sender: fabien@pseudo To: Tom Lane 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: <4028.1585579463@sss.pgh.pa.us> Message-ID: 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> <4028.1585579463@sss.pgh.pa.us> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="2056645051-373064571-1585632965=:16227" X-CLAMAV-SCAN: ok X-VRSPAM-SCORE: -100 X-VRSPAM-STATE: legit X-VRSPAM-CAUSE: gggruggvucftvghtrhhoucdtuddrgedugedrudeiiedgleeiucetufdoteggodetrfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeffhffvufgjkfhffgggtgesmhdtreertderjeenucfhrhhomhephfgrsghivghnucevqffgnffjqfcuoegtohgvlhhhohestghrihdrvghnshhmphdrfhhrqeenucfkphepkeekrddvudelrddvfeejrddutdeknecurfgrrhgrmhepmhhouggvpehsmhhtphhouhht X-VRSPAM-EXTCAUSE: mhhouggvpehsmhhtphhouhht List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --2056645051-373064571-1585632965=:16227 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT Hello, >> 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. My 0.02€: I agree that it is enough to reproduce the current behavior of various existing pg_ls* functions, but on the other hand outputing a column type char like ls (-, d, l…) looks like really no big deal. I'd say that the only reason not to do it may be to pass this before feature freeze. -- Fabien. --2056645051-373064571-1585632965=:16227--