Re: Global temporary tables

Dean Rasheed <dean.a.rasheed@gmail.com>

From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: John Naylor <johncnaylorls@gmail.com>
Cc: Andrew Dunstan <andrew@dunslane.net>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-07-06T09:43:42Z
Lists: pgsql-hackers

Attachments

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

Commits

  1. doc: clarify MERGE PARTITIONS adjacency requirement