Re: Global temporary tables - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: Global temporary tables
Date
Msg-id CAEZATCUhknD0kAkXVJeehvP10sEAwV8LCCNecrRvbBLm2vavCQ@mail.gmail.com
Whole thread
In response to Re: Global temporary tables  (Dean Rasheed <dean.a.rasheed@gmail.com>)
List pgsql-hackers
On Sun, 5 Jul 2026 at 10:58, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
>
> On Sun, 5 Jul 2026 at 09:17, John Naylor <johncnaylorls@gmail.com> wrote:
> >
> > I'm starting to think the queue mechanism needs serious attention, if
> > not a complete re-think.
>
> Yes, you're right. In that example, the pg_temp_class tuple gets lost
> entirely. It really needs the same sort of sub XID tracking as the
> usage/storage code

Attached is v7, doing that.

Locally, I have been stress-testing this using a hacked-together
python script that does random sequences of CREATE, DROP, BEGIN,
SAVEPOINT, RELEASE, ROLLBACK TO, INSERT, SELECT, COMMIT, ROLLBACK, and
TRUNCATE. I'm somewhat disappointed that it didn't pick up the
original problem, so I'll go back and look at it again.

v7 now also includes tempfrozenxid and tempminmxid in the
pg_stat_activity view, allowing those to be monitored.

Regards,
Dean

Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Re-read subscription state after lock in AlterSubscription
Next
From: Amit Kapila
Date:
Subject: Re: Proposal: Conflict log history table for Logical Replication