| From: | Nico Williams <nico(at)cryptonector(dot)com> |
|---|---|
| To: | Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> |
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Global temporary tables |
| Date: | 2026-07-04 01:00:49 |
| Message-ID: | akhbQYyzPgPIvbbR@ubby |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Sat, Jul 04, 2026 at 12:32:42AM +0100, Dean Rasheed wrote:
> On Thu, 2 Jul 2026 at 00:20, Nico Williams <nico(at)cryptonector(dot)com> wrote:
> >
> > I drove Claude through a review. You can too, so there's nothing
> > special to it, but I'll go over it here, with a bit of my content added,
> > and hopefully y'all don't hate me for sharing LLM outputs.
>
> Wow, we really will be out of a job in a few years :-)
I seriously doubt it. And I'm guessing you coded w/o assistance, so
hats off because it looks pretty good.
I only used an LLM for the review because I'm not sufficiently familiar
with PG internals to do a solid review myself, and I want to help this
along.
> > And, ah, well, I guess you could say that `relfrozenxid` in
> > `pg_class` is not meaningful for GTTs, or that you'll get your
> > session's GTT's relfrozenxid.
>
> Yes, that's a very accurate description of the design choice I made.
> Having thought more about it, I think the other choice is better,
> because it's simpler, and it reduces churn on pg_class.
Good. I think seeing some other session's frozenxid would be weird, and
a bit of a leak.
> So v6 now sets pg_class.relfrozenxid and pg_class.relminmxid to 0 for
> all global temporary relations, and only the pg_temp_class values are
> ever updated. That seems more logical, because a GTT has no storage
> until it is used by some session, so it makes sense for the frozen
> XIDs in pg_class to be 0.
Yes.
> I'll try and post another update soon, addressing other people's
> review comments.
I'll drive an LLM through this too sometime, especially with an eye to
testing.
I'm super excited to have GTTs in PG. It's going to make all sorts of
things much easier for me and many many others, so thank you so much!
Nico
--
| From | Date | Subject | |
|---|---|---|---|
| Next Message | jian he | 2026-07-04 01:09:22 | Re: implement CAST(expr AS type FORMAT 'template') |
| Previous Message | Thomas Munro | 2026-07-04 00:51:08 | Re: Can we get rid of TerminateThread() in pg_dump? |