Re: Global temporary tables - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: Global temporary tables
Date
Msg-id CAEZATCUSAQB3zRiycD=-xFXg-2rPRv9BtL6kFu3BsSwBnTWyoA@mail.gmail.com
Whole thread
In response to Re: Global temporary tables  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
On Tue, 30 Jun 2026 at 20:29, Pavel Stehule <pavel.stehule@gmail.com> wrote:
>
> I am testing this patchset. Generally, it looks very well. I didn't see any bloat on catalog
>
> I found an issue - TRUNCATE waits when gtt is used by different transactions, and TRUNCATE removes content in all
sessions.
>
> Is it expected?

Thanks for testing!

The waiting issue for TRUNCATE is interesting. I hadn't considered
that at all, so TRUNCATE on a global temporary table still takes an
access exclusive lock, like any other table, but I guess that's not
necessary. I wonder what lock level we could reduce it to.

I can't reproduce TRUNCATE removing content in all sessions, but
that's definitely not supposed to happen. Can you share what you did
to cause that?

Regards,
Dean



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: bump minimum supported version of psql and pg_{dump,dumpall,upgrade} to v10
Next
From: Alexander Korotkov
Date:
Subject: Re: BUG with accessing to temporary tables of other sessions still exists