Re: Do not lock temp relations

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Maxim Orlov <orlovmg(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Do not lock temp relations
Date: 2024-09-30 15:05:36
Message-ID: 1464449.1727708736@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Maxim Orlov <orlovmg(at)gmail(dot)com> writes:
> But for the second one: do we really need any lock for temp relations?

Yes. Our implementation restrictions preclude access to the contents
of another session's temp tables, but it is not forbidden to do DDL
on them so long as no content access is required. (Without this,
it'd be problematic for example to clean out a crashed session's temp
tables. See the "orphan temporary tables" logic in autovacuum.c.)
You need fairly realistic locking to ensure that's OK.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2024-09-30 15:06:57 Re: pg_verifybackup: TAR format backup verification
Previous Message Andrew Dunstan 2024-09-30 15:05:34 Re: msys inet_pton strangeness