Re: Unexpected changes of CurrentResourceOwner and CurrentMemoryContext

Mihail Nikalayeu <mihailnikalayeu@gmail.com>

From: Mihail Nikalayeu <mihailnikalayeu@gmail.com>
To: Antonin Houska <ah@cybertec.at>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2025-09-04T14:16:20Z
Lists: pgsql-hackers
Hello, Antonin!

    if (using_subtxn)
    {
       RollbackAndReleaseCurrentSubTransaction();
       MemoryContextSwitchTo(ccxt);
       CurrentResourceOwner = cowner;
    }

IIUC memory context is already switched above:

    MemoryContext ecxt = MemoryContextSwitchTo(ccxt);

Best regards,
Mikhail.



Commits

  1. Avoid unexpected changes of CurrentResourceOwner and CurrentMemoryContext