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

2024-01-21 Thread Peter Smith
2024-01 Commitfest. Hi, this patch was marked in CF as "Needs Review", but there has been no activity on this thread for 14+ months. Since there seems not much interest, I have changed the status to "Returned with Feedback" [1]. Feel free to propose a stronger use case for the patch and add an

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

2022-10-27 Thread Justin Pryzby
On Fri, Dec 13, 2019 at 03:03:47PM +1300, Thomas Munro wrote: > > Actually, I tried using pg_ls_tmpdir(), but it unconditionally masks > > non-regular files and thus shared filesets. Maybe that's worth > > discussion on a new thread ? > > > > src/backend/utils/adt/genfile.c > > /*

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

2022-06-23 Thread Justin Pryzby
This thread has been going for 2.5 years, so here's a(nother) recap. This omits the patches for recursion, since they're optional and evidently a distraction from the main patches. On Fri, Dec 27, 2019 at 11:02:20AM -0600, Justin Pryzby wrote: > The goal is to somehow show tmpfiles (or at least

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

2022-04-03 Thread Greg Stark
The cfbot is failing testing this patch. It seems... unlikely given the nature of the patch modifying an admin function that doesn't even modify the database that it should be breaking a streaming test. Perhaps the streaming test is using this function in the testing scaffolding? [03:19:29.564] #

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

2022-03-31 Thread Justin Pryzby
On Mon, Mar 14, 2022 at 09:37:25PM -0500, Justin Pryzby wrote: > The original, minimal goal of this patch was to show shared tempdirs in > pg_ls_tmpfile() - rather than hiding them misleadingly as currently happens. > 20200310183037.ga29...@telsasoft.com > 20200313131232.go29...@telsasoft.com > >

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

2022-03-28 Thread Justin Pryzby
On Sat, Mar 26, 2022 at 08:23:54PM +0900, Michael Paquier wrote: > On Wed, Mar 23, 2022 at 03:17:35PM +0900, Michael Paquier wrote: > > FWIW, per my review the bit of the patch set that I found the most > > relevant is the addition of a note in the docs of pg_stat_file() about > > the case where

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

2022-03-26 Thread Michael Paquier
On Wed, Mar 23, 2022 at 03:17:35PM +0900, Michael Paquier wrote: > FWIW, per my review the bit of the patch set that I found the most > relevant is the addition of a note in the docs of pg_stat_file() about > the case where "filename" is a link, because the code internally uses > stat(). The

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

2022-03-23 Thread Michael Paquier
On Mon, Mar 21, 2022 at 06:28:28PM -0700, Andres Freund wrote: > Doesn't apply cleanly anymore: http://cfbot.cputube.org/patch_37_2377.log > > Marked as waiting-on-author. FWIW, per my review the bit of the patch set that I found the most relevant is the addition of a note in the docs of

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

2022-03-21 Thread Andres Freund
Hi, On 2022-03-09 10:50:45 -0600, Justin Pryzby wrote: > Rebased over 9e9858389 (Michael may want to look at the tuplestore part?). Doesn't apply cleanly anymore: http://cfbot.cputube.org/patch_37_2377.log Marked as waiting-on-author. Greetings, Andres Freund

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

2022-03-14 Thread Michael Paquier
On Mon, Mar 14, 2022 at 09:37:25PM -0500, Justin Pryzby wrote: > One could argue that most of the pg_ls_* functions aren't needed (including > 1922d7c6e), since the same things are possible with pg_ls_dir() and > pg_stat_file(). > |1922d7c6e Add SQL functions to monitor the directory contents of

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

2022-03-14 Thread Justin Pryzby
On Mon, Mar 14, 2022 at 01:53:54PM +0900, Michael Paquier wrote: > On Wed, Mar 09, 2022 at 10:50:45AM -0600, Justin Pryzby wrote: > > I also changed pg_ls_dir_recurse() to handle concurrent removal of a dir, > > which > > I noticed caused an infrequent failure on CI. However I'm not including >

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

2022-03-14 Thread Michael Paquier
On Mon, Mar 14, 2022 at 01:53:54PM +0900, Michael Paquier wrote: > +select * from pg_ls_logicalmapdir() limit 0; > +select * from pg_ls_logicalsnapdir() limit 0; > +select * from pg_ls_replslotdir('') limit 0; > +select * from pg_ls_tmpdir() limit 0; > +select * from pg_ls_waldir() limit 0; >

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

2022-03-13 Thread Michael Paquier
On Wed, Mar 09, 2022 at 10:50:45AM -0600, Justin Pryzby wrote: > I also changed pg_ls_dir_recurse() to handle concurrent removal of a dir, > which > I noticed caused an infrequent failure on CI. However I'm not including that > here, since the 2nd half of the patch set seems isn't ready due to

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

2022-03-12 Thread Justin Pryzby
On Sun, Mar 13, 2022 at 09:45:35AM +0900, Michael Paquier wrote: > On Wed, Mar 09, 2022 at 10:50:45AM -0600, Justin Pryzby wrote: > > Rebased over 9e9858389 (Michael may want to look at the tuplestore part?). > > Are you referring to the contents of 0003 here that changes the > semantics of

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

2022-03-12 Thread Michael Paquier
On Wed, Mar 09, 2022 at 10:50:45AM -0600, Justin Pryzby wrote: > Rebased over 9e9858389 (Michael may want to look at the tuplestore part?). Are you referring to the contents of 0003 here that changes the semantics of pg_ls_dir_files() regarding its setup call? -- Michael signature.asc

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

2022-03-12 Thread Fabien COELHO
Hello Justin, Review about v34, up from v32 which I reviewed in January. v34 is an updated version of v32, without the part about lstat at the end of the series. All 7 patches apply cleanly. # part 01 One liner doc improvement about the directory flag. OK. # part 02 Add tests for

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

2022-03-10 Thread Fabien COELHO
Hello Justin, I hope to look at it over the week-end. -- Fabien Coelho - CRI, MINES ParisTech

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

2022-03-09 Thread Justin Pryzby
Rebased over 9e9858389 (Michael may want to look at the tuplestore part?). Fixing a comment typo. I also changed pg_ls_dir_recurse() to handle concurrent removal of a dir, which I noticed caused an infrequent failure on CI. However I'm not including that here, since the 2nd half of the patch

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

2022-01-25 Thread Justin Pryzby
On Sun, Jan 02, 2022 at 01:07:29PM +0100, Fabien COELHO wrote: > One liner doc improvement to tell that creation time is only available on > windows. > It is indeed not available on Linux. The change is about the "isflag" flag, not creation time. Returns a record containing the file's

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

2022-01-17 Thread Julien Rouhaud
Hi, On Sun, Jan 02, 2022 at 02:55:04PM +0100, Fabien COELHO wrote: > > > Here is my review about v32: > > I forgot to tell that doc generation for the cumulated changes also works. Unfortunately the patchset doesn't apply anymore: http://cfbot.cputube.org/patch_36_2377.log === Applying

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

2022-01-02 Thread Fabien COELHO
Here is my review about v32: I forgot to tell that doc generation for the cumulated changes also works. -- Fabien.

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

2022-01-02 Thread Fabien COELHO
Hello Justin, Happy new year! I think the 2nd half of the patches are still waiting for fixes to lstat() on windows. Not your problem? Here is my review about v32: All patches apply cleanly. # part 01 One liner doc improvement to tell that creation time is only available on windows. It

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

2021-12-23 Thread Justin Pryzby
On Thu, Dec 23, 2021 at 09:14:18AM -0400, Fabien COELHO wrote: > It seems that the v31 patch does not apply anymore: > > postgresql> git apply > ~/v31-0001-Document-historic-behavior-of-links-to-directori.patch > error: patch failed: doc/src/sgml/func.sgml:27410 > error:

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

2021-12-23 Thread Fabien COELHO
Hello Justin, It seems that the v31 patch does not apply anymore: postgresql> git apply ~/v31-0001-Document-historic-behavior-of-links-to-directori.patch error: patch failed: doc/src/sgml/func.sgml:27410 error: doc/src/sgml/func.sgml: patch does not apply -- Fabien.

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

2021-11-23 Thread Justin Pryzby
On Mon, Nov 22, 2021 at 07:17:01PM +, 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

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

2021-11-22 Thread Bossart, Nathan
In an attempt to get this patch set off the ground again, I took a look at the first 5 patches. 0001: This one is a very small documentation update for pg_stat_file to point out that isdir will be true for symbolic links to directories. Given this is true, I think the patch looks good. 0002:

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

2021-07-02 Thread Justin Pryzby
On Tue, Apr 06, 2021 at 11:01:31AM -0500, Justin Pryzby wrote: > 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

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

2021-04-08 Thread Justin Pryzby
Breaking with tradition, the previous patch included one too *few* changes, and failed to resolve the OID collisions. >From d3d33b25e8571f5a2a3124e85164321f19ca Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Mon, 16 Mar 2020 14:12:55 -0500 Subject: [PATCH v28 01/11] Document historic

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

2021-04-06 Thread Justin Pryzby
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

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

2021-03-15 Thread David Steele
On 12/23/20 2:27 PM, Stephen Frost wrote: * Justin Pryzby (pry...@telsasoft.com) wrote: On Mon, Nov 23, 2020 at 04:14:18PM -0500, Tom Lane wrote: * I don't think it's okay to change the existing signatures of pg_ls_logdir() et al. Even if you can make an argument that it's not too harmful to

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

2020-12-23 Thread Stephen Frost
Greetings, * Justin Pryzby (pry...@telsasoft.com) wrote: > On Mon, Nov 23, 2020 at 04:14:18PM -0500, Tom Lane wrote: > > * I don't think it's okay to change the existing signatures of > > pg_ls_logdir() et al. Even if you can make an argument that it's > > not too harmful to add more output

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

2020-12-23 Thread Justin Pryzby
On Mon, Nov 23, 2020 at 04:14:18PM -0500, Tom Lane wrote: > * I don't think it's okay to change the existing signatures of > pg_ls_logdir() et al. Even if you can make an argument that it's > not too harmful to add more output columns, replacing pg_stat_file's > isdir output with something of a

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

2020-12-09 Thread Justin Pryzby
On Fri, Dec 04, 2020 at 12:23:23PM -0500, Tom Lane wrote: > Justin Pryzby writes: > [ v24-0001-Document-historic-behavior-of-links-to-directori.patch ] > > The cfbot is unhappy with one of the test cases you added: > Maybe it could be salvaged by reversing the sense of the WHERE condition > so

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

2020-12-04 Thread Tom Lane
Justin Pryzby writes: [ v24-0001-Document-historic-behavior-of-links-to-directori.patch ] The cfbot is unhappy with one of the test cases you added: 6245@@ -259,9 +259,11 @@ 6246 select path, filename, type from pg_ls_dir_metadata('.', true, false, true) where

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

2020-11-29 Thread Justin Pryzby
On Mon, Nov 23, 2020 at 04:14:18PM -0500, Tom Lane wrote: > Justin Pryzby writes: > >> This patch has been waiting for input from a committer on the approach I've > >> taken with the patches since March 10, so I'm planning to set to "Ready" - > >> at > >> least ready for senior review. > > I

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

2020-11-24 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Stephen Frost writes: > > * Tom Lane (t...@sss.pgh.pa.us) wrote: > >> I took a quick look through this. This is just MHO, of course: > >> > >> * I don't think it's okay to change the existing signatures of > >> pg_ls_logdir() et al. > > > I

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

2020-11-23 Thread Tom Lane
Stephen Frost writes: > * Tom Lane (t...@sss.pgh.pa.us) wrote: >> I took a quick look through this. This is just MHO, of course: >> >> * I don't think it's okay to change the existing signatures of >> pg_ls_logdir() et al. > I disagree that we need to stress over this- we pretty routinely

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

2020-11-23 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Justin Pryzby writes: > >> This patch has been waiting for input from a committer on the approach I've > >> taken with the patches since March 10, so I'm planning to set to "Ready" - > >> at > >> least ready for senior review. > > I took a

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

2020-11-23 Thread Tom Lane
Justin Pryzby writes: >> This patch has been waiting for input from a committer on the approach I've >> taken with the patches since March 10, so I'm planning to set to "Ready" - at >> least ready for senior review. I took a quick look through this. This is just MHO, of course: * I don't think

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

2020-11-05 Thread Justin Pryzby
On Wed, Oct 28, 2020 at 02:34:02PM -0500, Justin Pryzby wrote: > On Tue, Sep 08, 2020 at 02:51:26PM -0500, Justin Pryzby wrote: > > On Sat, Jul 18, 2020 at 03:15:32PM -0500, Justin Pryzby wrote: > > > Still waiting for feedback from a committer. > > > > This patch has been waiting for input from

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

2020-10-28 Thread Justin Pryzby
On Tue, Sep 08, 2020 at 02:51:26PM -0500, Justin Pryzby wrote: > On Sat, Jul 18, 2020 at 03:15:32PM -0500, Justin Pryzby wrote: > > Still waiting for feedback from a committer. > > This patch has been waiting for input from a committer on the approach I've > taken with the patches since March 10,

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

2020-09-08 Thread Justin Pryzby
On Sat, Jul 18, 2020 at 03:15:32PM -0500, Justin Pryzby wrote: > Still waiting for feedback from a committer. This patch has been waiting for input from a committer on the approach I've taken with the patches since March 10, so I'm planning to set to "Ready" - at least ready for senior review.

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

2020-07-18 Thread Justin Pryzby
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

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

2020-07-14 Thread Justin Pryzby
On Sun, Jun 21, 2020 at 08:53:25PM -0500, Justin Pryzby wrote: > I'm still waiting to hear feedback from a commiter if this is a good idea to > put this into the system catalog. Right now, ts_debug is the only nontrivial > function. I'm still missing feedback from committers about the foundation

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

2020-06-21 Thread Justin Pryzby
On Sun, Jun 07, 2020 at 10:07:19AM +0200, Fabien COELHO wrote: > Hello Justin, > > Rebased onto 7b48f1b490978a8abca61e9a9380f8de2a56f266 and renumbered OIDs. Rebased again on whatever broke func.sgml. > pg_stat_file() and pg_stat_dir_files() now return a char type, as well as > the function

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

2020-06-07 Thread Fabien COELHO
Hello Justin, Rebased onto 7b48f1b490978a8abca61e9a9380f8de2a56f266 and renumbered OIDs. Some feedback about v18, seen as one patch. Patch applies cleanly & compiles. "make check" is okay. pg_stat_file() and pg_stat_dir_files() now return a char type, as well as the function which call

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

2020-05-25 Thread Justin Pryzby
Rebased onto 7b48f1b490978a8abca61e9a9380f8de2a56f266 and renumbered OIDs. >From bb41ae268041b7e7771930d533a8ca20a00805c7 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Mon, 16 Mar 2020 14:12:55 -0500 Subject: [PATCH v18 01/10] Document historic behavior of links to directories.. Backpatch

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

2020-05-07 Thread Justin Pryzby
Rebased onto 1ad23335f36b07f4574906a8dc66a3d62af7c40c >From 698026f6365a324bf52c5985d549f71b52ada567 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Mon, 16 Mar 2020 14:12:55 -0500 Subject: [PATCH v17 01/10] Document historic behavior of links to directories.. Backpatch to 9.5: pg_stat_file

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

2020-05-02 Thread Justin Pryzby
On Sun, Apr 12, 2020 at 01:53:40PM +0200, Fabien COELHO wrote: > About v15, seen as one patch. Thanks for looking. > - I'm wondering whether could pg_stat_file call pg_ls_dir_files without > too much effort? ISTM that the output structure nearly the same. I do > not like much having one

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

2020-04-12 Thread Fabien COELHO
Hello Justin, About v15, seen as one patch. Patches serie applies cleanly, compiles, "make check" ok. Documentation: - indent documentation text around 80 cols, as done around? - indent SQL example for readability and capitalize keywords (pg_ls_dir_metadata) - "For each file in a

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

2020-03-31 Thread Justin Pryzby
On Tue, Mar 17, 2020 at 02:04:01PM -0500, Justin Pryzby wrote: > > The example in the documentation could be better indented. Also, ISTM that > > there are two implicit laterals (format & pg_ls_dir_recurse) that I would > > make explicit. I'd use the pcs alias explicitely. I'd use meaningful

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

2020-03-17 Thread Tom Lane
Justin Pryzby writes: > It seems like the only way to make variable number of arguments is is with > multiple entries in pg_proc.dat, one for each "number of" arguments. Is that > right ? Another way to do it is to have one entry, put the full set of arguments into the initial pg_proc.dat data,

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

2020-03-17 Thread Justin Pryzby
On Tue, Mar 17, 2020 at 10:21:48AM +0100, Fabien COELHO wrote: > > About v13, seens as one patch: > > Function "pg_ls_dir_metadata" documentation suggests a variable number of > arguments with brackets, but parameters are really mandatory. Fixed, and added tests on 1 and 3 arg versions of both

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

2020-03-17 Thread Fabien COELHO
About v13, seens as one patch: Function "pg_ls_dir_metadata" documentation suggests a variable number of arguments with brackets, but parameters are really mandatory. postgres=# SELECT pg_ls_dir_metadata('.'); ERROR: function pg_ls_dir_metadata(unknown) does not exist LINE 1: SELECT

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

2020-03-16 Thread Justin Pryzby
On Mon, Mar 16, 2020 at 07:17:36PM -0300, Alvaro Herrera wrote: > I pushed 0001 and 0003 (as a single commit). archive_statusdir didn't > get here until 12, so your commit message was mistaken. Also, pg10 is > slightly different so it didn't apply there, so I left it alone. Thanks, I appreciate

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

2020-03-16 Thread Alvaro Herrera
I pushed 0001 and 0003 (as a single commit). archive_statusdir didn't get here until 12, so your commit message was mistaken. Also, pg10 is slightly different so it didn't apply there, so I left it alone. -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development,

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

2020-03-16 Thread Justin Pryzby
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

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

2020-03-16 Thread Fabien COELHO
Hello Justin, psql> SELECT * FROM pg_ls_dir_recurse('.'); ERROR: could not stat file

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

2020-03-16 Thread Justin Pryzby
On Mon, Mar 16, 2020 at 04:20:21PM +0100, Fabien COELHO wrote: > > About v11, ISTM that the recursive function should check for symbolic links > and possibly avoid them: > > sh> cd data/base > sh> ln -s .. foo > > psql> SELECT * FROM pg_ls_dir_recurse('.'); > ERROR: could not stat file >

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

2020-03-16 Thread Fabien COELHO
About v11, ISTM that the recursive function should check for symbolic links and possibly avoid them: sh> cd data/base sh> ln -s .. foo psql> SELECT * FROM pg_ls_dir_recurse('.'); ERROR: could not stat file

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

2020-03-15 Thread Justin Pryzby
On Sun, Mar 15, 2020 at 06:15:02PM +0100, Fabien COELHO wrote: > Some feedback on v10: Thanks for looking. I'm hoping to hear from Alvaro what he thinks of this approach (all functions to show isdir, rather than one function which lists recursively). > All patches apply cleanly, one on top of

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

2020-03-15 Thread Fabien COELHO
Hello Justin, Some feedback on v10: All patches apply cleanly, one on top of the previous. I really wish there would be less than 9 patches… * v10.1 doc change: ok * v10.2 doc change: ok, not sure why it is not merged with previous * v10.3 test add: could be merge with both previous

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

2020-03-13 Thread Justin Pryzby
@cfbot: rebased onto 085b6b6679e73b9b386f209b4d625c7bc60597c0 The merge conflict presents another opportunity to solicit comments on the new approach. Rather than making "recurse into tmpdir" the end goal: - add a function to show metadata of an arbitrary dir; - add isdir arguments to

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

2020-03-10 Thread Justin Pryzby
I took a step back, and I wondered whether we should add a generic function for listing a dir with metadata, possibly instead of changing the existing functions. Then one could do pg_ls_dir_metadata('pg_wal',false,false); Since pg8.1, we have pg_ls_dir() to show a list of files. Since pg10,

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

2020-03-08 Thread Fabien COELHO
Hello Justin, Patch series applies cleanly. The last status compiles and passes "make check". A few more comments: * v8.[123] ok. * v8.4 Avoid using the type name as a field name? "enum dir_action dir_action;" -> "enum dir_action action", or maybe rename "dir_action" enum

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

2020-03-07 Thread Justin Pryzby
On Sat, Mar 07, 2020 at 03:14:37PM +0100, Fabien COELHO wrote: > The documentation sentences could probably be improved "for for", "used ... > used". Maybe: > ISTM that several instances of: "pg_ls_dir_files(..., true, false);" should > be "pg_ls_dir_files(..., true, DIR_HIDE);". > Alas, ISTM

Re: pg_ls_tmpdir to show directories and shared filesets

2020-03-07 Thread Fabien COELHO
It seems that lists are used as FIFO structures by appending, fetching & deleting last, all of which are O(n). ISTM it would be better to use the head of the list by inserting, getting and deleting first, which are O(1). I think you're referring to linked lists, but pglists are now arrays,

Re: pg_ls_tmpdir to show directories and shared filesets

2020-03-07 Thread Justin Pryzby
On Sat, Mar 07, 2020 at 03:14:37PM +0100, Fabien COELHO wrote: > Some feedback about the v7 patch set. Thanks for looking again > About v7.1, seems ok. > > About v7.2 & v7.3 seems ok, altought the two could be merged. These are separate since I proprose that one should be backpatched to v12

Re: pg_ls_tmpdir to show directories and shared filesets

2020-03-07 Thread Fabien COELHO
Hello Justin, Some feedback about the v7 patch set. About v7.1, seems ok. About v7.2 & v7.3 seems ok, altought the two could be merged. About v7.4: The documentation sentences could probably be improved "for for", "used ... used". Maybe: For the temporary directory for tablespace, ...

Re: pg_ls_tmpdir to show directories and shared filesets

2020-03-06 Thread Justin Pryzby
On Thu, Mar 05, 2020 at 10:18:38AM -0600, Justin Pryzby wrote: > I'm not sure if prefer the 0002 patch alone (which recurses into dirs all at > once during the initial call), or 0002+3+4, which incrementally reads the dirs > on each call (but requires keeping dirs opened). I fixed an issue that

Re: pg_ls_tmpdir to show directories and shared filesets

2020-03-05 Thread Justin Pryzby
On Tue, Mar 03, 2020 at 05:23:13PM -0300, Alvaro Herrera wrote: > On 2020-Mar-03, Justin Pryzby wrote: > > > But I don't think it makes sense to go through more implementation/review > > cycles without some agreement from a larger group regarding the > > desired/intended interface. Should there