Re: Xact end leaves CurrentMemoryContext = TopMemoryContext

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Xact end leaves CurrentMemoryContext = TopMemoryContext
Date: 2024-06-18 20:48:18
Message-ID: 4189339.1718743698@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2024-06-18 21:09:09 Re: allow changing autovacuum_max_workers without restarting
Previous Message Andres Freund 2024-06-18 20:43:34 Re: allow changing autovacuum_max_workers without restarting