Re: Unexpected changes of CurrentResourceOwner and CurrentMemoryContext

From: Mihail Nikalayeu <mihailnikalayeu(at)gmail(dot)com>
To: Antonin Houska <ah(at)cybertec(dot)at>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Unexpected changes of CurrentResourceOwner and CurrentMemoryContext
Date: 2025-09-12 22:57:52
Message-ID: CADzfLwUpXJ+Vn_Wm-wKC5a8qJut+j_tnXhLF_1kH9HXFKsoHFg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

> Hello, Antonin!
>
> if (using_subtxn)
> {
> RollbackAndReleaseCurrentSubTransaction();
> MemoryContextSwitchTo(ccxt);
> CurrentResourceOwner = cowner;
> }
>
> IIUC memory context is already switched above:
>
> MemoryContext ecxt = MemoryContextSwitchTo(ccxt);
>

Finally realized RollbackAndReleaseCurrentSubTransaction leaves as
with TransactionAbortContext, so, nevermind :)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2025-09-13 00:16:11 Re: RFC: extensible planner state
Previous Message Tom Lane 2025-09-12 22:53:10 Re: Avoid resource leak (src/test/modules/test_binaryheap/test_binaryheap.c)