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-07-18 20:15:32
Message-ID: 20200718201532.GV23581@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 14, 2020 at 10:08:39PM -0500, Justin Pryzby wrote:
> I'm still missing feedback from committers about the foundation of this
> approach.

Now rebased on top of fix for my own bug report (1d09fb1f).

I also changed argument handling for pg_ls_dir_recurse().

Passing '.' gave an initial path of . (of course) but then every other path
begins with './' which I didn't like, since it's ambiguous with empty path, or
.// or ././ ... And one could pass './' which gives different output (like
././).

So I specially handled the input of '.'. Maybe the special value should be
NULL instead of ''. But it looks no other system functions are currently
non-strict.

For pg_rewind testcase, getting the output path+filename uses a coalesce, since
the rest of the test does stuff like strcmp("pg_wal").

Still waiting for feedback from a committer.

--
Justin

Attachment Content-Type Size
v21-0001-Document-historic-behavior-of-links-to-directori.patch text/x-diff 1.1 KB
v21-0002-pg_stat_file-and-pg_ls_dir_-to-use-lstat.patch text/x-diff 2.3 KB
v21-0003-Add-tests-on-pg_ls_dir-before-changing-it.patch text/x-diff 2.0 KB
v21-0004-Add-pg_ls_dir_metadata-to-list-a-dir-with-file-m.patch text/x-diff 19.0 KB
v21-0005-pg_ls_tmpdir-to-show-directories-and-isdir-argum.patch text/x-diff 6.7 KB
v21-0006-pg_ls_-dir-to-show-directories-and-isdir-column.patch text/x-diff 8.8 KB
v21-0007-Add-pg_ls_dir_recurse-to-show-dir-recursively.patch text/x-diff 8.6 KB
v21-0008-pg_ls_logdir-to-ignore-error-if-initial-top-dir-.patch text/x-diff 3.1 KB
v21-0009-pg_ls_-dir-to-return-all-the-metadata-from-pg_st.patch text/x-diff 19.8 KB
v21-0010-pg_ls_-to-show-file-type-and-show-special-files.patch text/x-diff 21.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2020-07-18 21:17:37 Re: Default setting for enable_hashagg_disk
Previous Message Ranier Vilela 2020-07-18 19:27:36 Re: CID 1428952 (#1 of 1): Out-of-bounds access (OVERRUN) (src/backend/commands/async.c)