Re: Xact end leaves CurrentMemoryContext = TopMemoryContext

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: David Rowley <dgrowleyml@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2024-06-18T20:48:18Z
Lists: pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> I wonder if there's an argument the "persistent" TopTransactionContext should
> live under a different name outside of transactions, to avoid references to it
> working in a context where it's not valid?   It's probably not worth it, but
> not sure.

Hm.  We could stash the long-lived pointer in a static variable,
and only install it in TopTransactionContext when you're supposed
to use it.  I tend to agree not worth it, though.

			regards, tom lane



Commits

  1. Split vacuumdb to create vacuuming.c/h

  2. Preserve CurrentMemoryContext across notify and sinval interrupts.

  3. Preserve CurrentMemoryContext across Start/CommitTransactionCommand.