Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed atend-of-transaction - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed atend-of-transaction
Date
Msg-id 20200312124917.GA8369@alvherre.pgsql
Whole thread Raw
In response to Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed atend-of-transaction  (Justin Pryzby <pryzby@telsasoft.com>)
Responses Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Nitpick: please see c4dcd9144ba6.

> From: Justin Pryzby <pryzbyj@telsasoft.com>
> Date: Wed, 11 Mar 2020 10:09:18 -0500
> Subject: [PATCH] SRF: avoid leaking resources if not run to completion
> 
> Change to return a tuplestore populated immediately and returned in full.
> 
> Discussion: https://www.postgresql.org/message-id/20200308173103.GC1357%40telsasoft.com

I wonder if this isn't saying that the whole value-per-call protocol is
bogus, in that it seems impossible to write a useful function with it.
Maybe we should add one final call with a special flag "function
shutdown" or something, so that these resources can be released if the
SRF isn't run to completion?

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Berserk Autovacuum (let's save next Mandrill)
Next
From: Alexey Kondratov
Date:
Subject: Re: [Patch] pg_rewind: options to use restore_command fromrecovery.conf or command line