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
- v7-0001-Save-temporary-table-ON-COMMIT-actions-to-pg_clas.patch (text/x-patch) patch v7-0001
- v7-0002-Basic-support-for-global-temporary-tables.patch (text/x-patch) patch v7-0002
- v7-0003-Support-indexes-on-global-temporary-tables.patch (text/x-patch) patch v7-0003
- v7-0004-Support-global-temporary-sequences.patch (text/x-patch) patch v7-0004
- v7-0005-Support-global-temporary-catalog-tables-and-add-p.patch (text/x-patch) patch v7-0005
- v7-0006-Add-relation-statistics-columns-to-pg_temp_class.patch (text/x-patch) patch v7-0006
- v7-0007-Add-relfrozenxid-and-relminmxid-columns-to-pg_tem.patch (text/x-patch) patch v7-0007
- v7-0008-Add-pg_temp_statistic-global-temporary-catalog-ta.patch (text/x-patch) patch v7-0008
- v7-0009-Add-pg_temp_statistic_ext_data-global-temporary-c.patch (text/x-patch) patch v7-0009
- v7-0010-Add-pg_temp_index-global-temporary-catalog-table.patch (text/x-patch) patch v7-0010
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
-
doc: clarify MERGE PARTITIONS adjacency requirement
- 57f19774d6c8 master cited