Re: Memory leak with CALL to Procedure with COMMIT.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org>, Michael Paquier <michael(at)paquier(dot)xyz>, Prabhat Sahu <prabhat(dot)sahu(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Memory leak with CALL to Procedure with COMMIT.
Date: 2018-08-16 17:08:40
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> Hmm, this got me thinking whether the current resource owner setup for a
> procedure is appropriate. Maybe the problem is that resowners are still
> thought of in terms of transactions plus portals, so that if
> transactions are done then everything is over; maybe we need to teach
> them that procedures can outlive transactions, so you'd have a resowner
> that's global to the procedure and then each transaction resowner is a
> child of that one?

The procedure still has to be running inside a query, and therefore
inside a portal, so the portal's resowner ought to be sufficiently
long-lived for any resources that ought to be procedure-lifetime.
So I doubt we need any more resowners. It's certainly possible that
something somewhere is assigning a particular resource to the wrong
resowner, of course.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marina Polyakova 2018-08-16 17:12:50 Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors
Previous Message Vladimir Sitnikov 2018-08-16 17:08:20 Re: Stored procedures and out parameters