Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, David Steele <david(at)pgmasters(dot)net>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Subject: Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction
Date: 2020-03-16 15:53:06
Message-ID: 20200316155306.GM26184@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Mar 12, 2020 at 07:11:56AM -0500, Justin Pryzby wrote:
> > Do you want to have a go at that?
>
> First draft attached. Note that I handled pg_ls_dir, even though I'm proposing
> on the other thread to collapse/merge/meld it with pg_ls_dir_files [0].
> Possibly that's a bad idea with tuplestore, due to returning a scalar vs a row
> and needing to conditionally call CreateTemplateTupleDesc vs
> get_call_result_type. I'll rebase that patch later today.
>
> I didn't write test cases yet. Also didn't look for functions not on your
> list.
>
> I noticed this doesn't actually do anything, but kept it for now...except in
> pg_ls_dir error case:
>
> src/include/utils/tuplestore.h:/* tuplestore_donestoring() used to be required, but is no longer used */
> src/include/utils/tuplestore.h:#define tuplestore_donestoring(state) ((void) 0)

v2 attached - I will add to next CF in case you want to defer it until later.

--
Justin

Attachment Content-Type Size
v2-0001-SRF-avoid-leaking-resources-if-not-run-to-complet.patch text/x-diff 28.9 KB
v2-0002-Clean-up-existing-anti-pattern-of-freeing-SRF-res.patch text/x-diff 8.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Steele 2020-03-16 16:01:29 Re: [PATCH] Connection time for \conninfo
Previous Message Justin Pryzby 2020-03-16 15:41:36 Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*)