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

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: 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>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*)
Date: 2020-03-16 21:48:06
Message-ID: 20200316214806.GQ26184@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 16, 2020 at 04:20:21PM +0100, Fabien COELHO wrote:
> This probably means using lstat instead of (in supplement to?) stat, and
> probably tell if something is a link, and if so not recurse in them.

On Mon, Mar 16, 2020 at 07:21:06PM +0100, Fabien COELHO wrote:
> IMHO, I really think that it should be included. Dealing with links is no
> big deal, but you need an additional column in _metadata to tell it is a
> link

Instead of showing another column, I changed to show links with isdir=false.
At the cost of two more patches, to allow backpatching docs and maybe separate
commit to make the subtle change obvious in commit history, at least.

I see a few places in the backend and a few more in the fronted using the same
logic that I used for islink(), but I'm not sure if there's a good place to put
that to allow factoring out at least the other backend ones.

--
Justin

Attachment Content-Type Size
v12-0001-Document-historic-behavior-about-hiding-director.patch text/x-diff 1.7 KB
v12-0002-Document-historic-behavior-of-links-to-directori.patch text/x-diff 1.1 KB
v12-0003-Document-historic-behavior-about-hiding-director.patch text/x-diff 908 bytes
v12-0004-Add-tests-exercizing-pg_ls_tmpdir.patch text/x-diff 4.3 KB
v12-0005-Add-pg_ls_dir_metadata-to-list-a-dir-with-file-m.patch text/x-diff 11.6 KB
v12-0006-Show-links-to-dirs-with-isdir-false.patch text/x-diff 2.6 KB
v12-0007-pg_ls_tmpdir-to-show-isdir-argument.patch text/x-diff 7.6 KB
v12-0008-pg_ls_-dir-to-show-directories-and-isdir-column.patch text/x-diff 10.6 KB
v12-0009-Add-pg_ls_dir_recurse-to-show-dir-recursively.patch text/x-diff 5.3 KB
v12-0010-pg_ls_logdir-to-ignore-error-if-initial-top-dir-.patch text/x-diff 3.1 KB
v12-0011-pg_ls_-dir-to-return-all-the-metadata-from-pg_st.patch text/x-diff 15.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2020-03-16 21:49:12 Re: Planning counters in pg_stat_statements (using pgss_store)
Previous Message Alvaro Herrera 2020-03-16 21:41:58 Re: Portal->commandTag as an enum