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 1mpfmT-0004v0-01 for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Nov 2021 00:04:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mpfmR-0005zH-Gy for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Nov 2021 00:04:55 +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 1mpfmQ-0005yq-Uy for pgsql-hackers@lists.postgresql.org; Wed, 24 Nov 2021 00:04:55 +0000 Received: from mail-io1-xd2d.google.com ([2607:f8b0:4864:20::d2d]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mpfmK-0007zu-St for pgsql-hackers@postgresql.org; Wed, 24 Nov 2021 00:04:54 +0000 Received: by mail-io1-xd2d.google.com with SMTP id x10so850363ioj.9 for ; Tue, 23 Nov 2021 16:04:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fpFPlvQq6UlIlGouThoECAlJ66aDRWPNJTHYgXsy0pk=; b=JhDXjrCRJebopjc/aiL8klgtUCLsMCrk/zmWhkg7gL3vHOSrTdxpTPfwpGNLMAaOaF EQc4+6ZVIhNCsfqlOeoRj2Ty0loTB2XfVgzzfzuXncaQg+Y3W2VMpTnd6cFxCQR2F3TK +43vBE0f7fBOQxJZa66E6vBMf/spoBtpSVUJhXieyDtomVGgD4g7RBLWdgJYloKbufXM b+IOEGBCk8fnAHo2T4g6SkkwED8fU/I3ZhUJbaFOvQT0qp9EsL6t7kOqz116341xv4gQ 5CGTkIfaC0GRIF8sxzHdrCdHQy8djWCNvy8lqWzwramfbud1tCo5MvfmiiQFU1k27Vod Ou4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=fpFPlvQq6UlIlGouThoECAlJ66aDRWPNJTHYgXsy0pk=; b=Ns1nlhXuPD/4l6SF7jAflFFztRixF7SL1n60MDA/yHixXGP+2Ybg8qsLBSvrCH/2TP tpf+EjnWDfjLYZo8+cqio5+XzoNg1aCr0t+9tinqxD9aEd1AagrdbJSRVAnsATYPklC2 S3m8Gb8796ZknsbMHHpkkA6HA+L2GoqOjMXs8Meb0ToCTB4cq6mrzMUnl2iIUA4JIPGX 1HIvyrMLrjRtZpr+Tmx7tDegE5ki3TjF2PcTlNsdQ8yA3JqGcbg20JqAfAf78pul9KP1 O/HGUOpNvsra/wxgOyvNkLEeb4gOm/ZWtVDZF+Buga22QivmoVCDGuEdADlO314AYXcw OniA== X-Gm-Message-State: AOAM530Cmmv2mQ0sYh+XCse86v6Wyx363RTDouxAHKbHkx64COqbsU+E ggVrMrxW9ijV3RXaSk+t31tdOQ== X-Google-Smtp-Source: ABdhPJwzF9JuwBOe4NTVwh+i6+0KrI2veE74DnMGlmGY1BzU36m0rdOkENqpD1UFN8fmOu4LAd5uQA== X-Received: by 2002:a05:6638:164b:: with SMTP id a11mr10868305jat.30.1637712286577; Tue, 23 Nov 2021 16:04:46 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id k11sm11067548ilv.66.2021.11.23.16.04.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Nov 2021 16:04:45 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 5E721800567; Tue, 23 Nov 2021 18:04:44 -0600 (CST) Date: Tue, 23 Nov 2021 18:04:44 -0600 From: Justin Pryzby To: "Bossart, Nathan" Cc: Tom Lane , Stephen Frost , Fabien COELHO , Alvaro Herrera , David Steele , pgsql-hackers@postgresql.org, Thomas Munro Subject: Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*) Message-ID: <20211124000444.GX17618@telsasoft.com> References: <20201124165322.GS16415@tamriel.snowman.net> <198112.1606172779@sss.pgh.pa.us> <20201123230031.GR16415@tamriel.snowman.net> <129225.1606166058@sss.pgh.pa.us> <20201223191710.GR30237@telsasoft.com> <20210406160131.GA6592@telsasoft.com> <20210702191637.GV21248@telsasoft.com> <2AF5FE35-82CB-4259-BF97-30D947803132@amazon.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="qZVVwWJgpX9Jzs7f" Content-Disposition: inline In-Reply-To: <2AF5FE35-82CB-4259-BF97-30D947803132@amazon.com> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --qZVVwWJgpX9Jzs7f Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Nov 22, 2021 at 07:17:01PM +0000, Bossart, Nathan wrote: > In an attempt to get this patch set off the ground again, I took a > look at the first 5 patches. > I haven't looked at the following patches too much, but I'm getting > the idea that they might address a lot of the feedback above and that > the first bunch of patches are more like staging patches that add the > abilities without changing the behavior. I wonder if just going > straight to the end goal behavior might simplify the patch set a bit. > I can't say I feel too strongly about this, but I figure I'd at least > share my thoughts. Thanks for looking. The patches are separate since the early patches are the most necessary, least disputable parts, to allow the possibility of (say) chaging pg_ls_tmpdir() without changing other functions, since pg_ls_tmpdir was was original motivation behind this whole thread. In a recent thread, Bharath Rupireddy added pg_ls functions for the logical dirs, but expressed a preference not to add the metadata columns. I still think that at least "isdir" should be added to all the "ls" functions, since it's easy to SELECT the columns you want, and a bit of a pain to write the corresponding LATERAL query: 'dir' AS dir, pg_ls_dir(dir) AS ls, pg_stat_file(ls) AS st. I think it would be strange if pg_ls_tmpdir() were to return a different set of columns than the other functions, even though admins or extensions might have created dirs or other files in those directories. Tom pointed out that we don't have a working lstat() for windows, so then it seems like we're not yet ready to show file "types" (we'd show the type of the link target, which is sometimes what's wanted, but not usually what "ls" would show), nor ready to implement recurse. As before: On Tue, Apr 06, 2021 at 11:01:31AM -0500, Justin Pryzby wrote: > The first handful of patches address the original issue, and I think could be > "ready": > > $ git log --oneline origin..pg-ls-dir-new |tac > ... Document historic behavior of links to directories.. > ... Add tests on pg_ls_dir before changing it > ... Add pg_ls_dir_metadata to list a dir with file metadata.. > ... pg_ls_tmpdir to show directories and "isdir" argument.. > ... pg_ls_*dir to show directories and "isdir" column.. > > These others are optional: > ... pg_ls_logdir to ignore error if initial/top dir is missing.. > ... pg_ls_*dir to return all the metadata from pg_stat_file.. > > ..and these maybe requires more work for lstat on windows: > ... pg_stat_file and pg_ls_dir_* to use lstat().. > ... pg_ls_*/pg_stat_file to show file *type*.. > ... Preserve pg_stat_file() isdir.. > ... Add recursion option in pg_ls_dir_files.. rebased on 1922d7c6e1a74178bd2f1d5aa5a6ab921b3fcd34 -- Justin --qZVVwWJgpX9Jzs7f Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v31-0001-Document-historic-behavior-of-links-to-directori.patch"