Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*)

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, David Steele <david(at)pgmasters(dot)net>, pgsql-hackers(at)postgresql(dot)org, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Subject: Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*)
Date: 2021-04-06 16:01:31
Message-ID: 20210406160131.GA6592@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 23, 2020 at 01:17:10PM -0600, Justin Pryzby wrote:
> On Mon, Nov 23, 2020 at 04:14:18PM -0500, Tom Lane wrote:
> > * I noticed that you did s/stat/lstat/. That's fine on Unix systems,
> > but it won't have any effect on Windows systems (cf bed90759f),
> > which means that we'll have to document a platform-specific behavioral
> > difference. Do we want to go there?
> >
> > Maybe this patch needs to wait on somebody fixing our lack of real lstat() on Windows.
>
> I think only the "top" patches depend on lstat (for the "type" column and
> recursion, to avoid loops). The initial patches are independently useful, and
> resolve the original issue of hiding tmpdirs. I've rebased and re-arranged the
> patches to reflect this.

I said that, but then failed to attach the re-arranged patches.
Now I also renumbered OIDs following best practice.

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..

--
Justin

Attachment Content-Type Size
v27-0001-Document-historic-behavior-of-links-to-directori.patch text/x-diff 1.1 KB
v27-0002-Add-tests-on-pg_ls_dir-before-changing-it.patch text/x-diff 2.3 KB
v27-0003-Add-pg_ls_dir_metadata-to-list-a-dir-with-file-m.patch text/x-diff 19.1 KB
v27-0004-pg_ls_tmpdir-to-show-directories-and-isdir-argum.patch text/x-diff 6.3 KB
v27-0005-pg_ls_-dir-to-show-directories-and-isdir-column.patch text/x-diff 9.1 KB
v27-0006-pg_ls_logdir-to-ignore-error-if-initial-top-dir-.patch text/x-diff 3.1 KB
v27-0007-pg_ls_-dir-to-return-all-the-metadata-from-pg_st.patch text/x-diff 17.6 KB
v27-0008-pg_stat_file-and-pg_ls_dir_-to-use-lstat.patch text/x-diff 2.3 KB
v27-0009-pg_ls_-pg_stat_file-to-show-file-type.patch text/x-diff 21.5 KB
v27-0010-Preserve-pg_stat_file-isdir.patch text/x-diff 4.5 KB
v27-0011-Add-recursion-option-in-pg_ls_dir_files.patch text/x-diff 16.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message James Coleman 2021-04-06 16:13:38 Re: [EXTERNAL] Any objection to documenting pg_sequence_last_value()?
Previous Message Julien Rouhaud 2021-04-06 15:49:16 Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?