Re: Memory leak with CALL to Procedure with COMMIT. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Memory leak with CALL to Procedure with COMMIT.
Date
Msg-id 19388.1534439320@sss.pgh.pa.us
Whole thread Raw
In response to Re: Memory leak with CALL to Procedure with COMMIT.  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.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


pgsql-hackers by date:

Previous
From: Vladimir Sitnikov
Date:
Subject: Re: Stored procedures and out parameters
Next
From: Marina Polyakova
Date:
Subject: Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors