| From: | Kirk Wolak <wolakk(at)gmail(dot)com> |
|---|---|
| To: | Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> |
| Cc: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Global temporary tables |
| Date: | 2026-06-26 21:37:21 |
| Message-ID: | CACLU5mQD5d+pTt46TUP4Wi=YvJT6LkizXtmj9na+DmQqac=FCw@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Fri, Jun 26, 2026 at 3:37 PM Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
wrote:
> On Fri, 26 Jun 2026 at 04:52, Kirk Wolak <wolakk(at)gmail(dot)com> wrote:
> >
> > + 1 for the idea. I will try to review this over the weekend. We could
> use this.
>
> Thanks. Any reviews will be very helpful.
>
> In the meantime, comparing the 2 patchsets, I realised that there was
> a bug in mine -- ON COMMIT DELETE ROWS wasn't working properly in all
> cases.
>
> ...
>
> Not saving the ON COMMIT action to the database kind-of made sense for
> old-style temporary tables, since they disappear at the end of the
> session. However, even then, it can be useful to have it in the
> database so that psql's \d meta-command can display it, and of course,
> for global temporary tables, saving it to the database is essential so
> that new sessions can pick it up.
>
Okay, a small "nit" on your wording. No new "sessions" should see any data.
They can't see that data, as it is not theirs.
\d should see it. Future selects should see it.
In our case, we use this because we do a crap ton of work in temp tables
(unlogged).
And then we commit (along with the flags that indicate we are 1/2 done, and
the timing logs).
Then, we insert that into the table we want to see that data.
Mark ourselves fully done.
COMMIT.
Temp data is still there, but then we disconnect and the table data goes
away.
...
>
> Regards,
> Dean
>
Kirk
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bharath Rupireddy | 2026-06-26 22:18:25 | Re: enhance wraparound warnings |
| Previous Message | Bharath Rupireddy | 2026-06-26 21:19:37 | Re: Handle concurrent drop when doing whole database vacuum |