Re: Temp table handling after anti-wraparound shutdown (Was: BUG#15840) - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Temp table handling after anti-wraparound shutdown (Was: BUG#15840)
Date
Msg-id 20190609213126.uutlkqlrsud3bdfs@alap3.anarazel.de
Whole thread Raw
In response to Re: Temp table handling after anti-wraparound shutdown (Was: BUG#15840)  (Thierry Husson <thusson@informiciel.com>)
Responses Re: Temp table handling after anti-wraparound shutdown (Was: BUG#15840)
List pgsql-hackers
Hi,

(on postgres lists, please do not top-quote).

On 2019-06-08 04:06:39 -0500, Thierry Husson wrote:
> In fact, I suppose all temporary tables and their content could be
> completly ignored by MVCC principles as they are not subject to
> concurrency being unmodifiable/unreadable by other connections.

That'd cause corruption, because vacuum would then remove resources that
the temp table might rely on (commit log, multixacts, ...).


> The separate situation, as noted by Michael, could be done at connection
> time, when PG gives a temporay schema to it. When it create a pg_temp_XXX
> schema, it could make sure it's completely empty and otherwise remove
> everything in it.

That already happens, but unfortunately only too late. IIRC We only do
so once the first temp table in a session is created.


> I already had a DB corruption because system tables weren't in sync
> about these tables/schemas after a badly closed connection, so it was
> impossible to make a drop table on them. So it could be even safer to
> clear everything directly from system tables instead of calling drop
> table for each leftover temp table.

Hm, I'd like to know more about that corruption. Did you report it when
it occured?

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Siarhei Siniak
Date:
Subject: GiST limits on contrib/cube with dimension > 100?
Next
From: David Rowley
Date:
Subject: Re: Custom table AMs need to include heapam.h because of BulkInsertState