Re: [PROPOSAL] Drop orphan temp tables in single-mode - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PROPOSAL] Drop orphan temp tables in single-mode
Date
Msg-id 8593.1551969588@sss.pgh.pa.us
Whole thread Raw
In response to [PROPOSAL] Drop orphan temp tables in single-mode  (Arthur Zakirov <a.zakirov@postgrespro.ru>)
Responses Re: [PROPOSAL] Drop orphan temp tables in single-mode
List pgsql-hackers
Arthur Zakirov <a.zakirov@postgrespro.ru> writes:
> In some cases if PostgreSQL encounters with wraparound PostgreSQL might 
> leave created temporary tables even after shutdown.
> This orphan temporary tables prevent VACUUM to fix wraparound. It is 
> because in single mode VACUUM considers orphan temp tables as temp 
> tables of other backends.

Hm.

> This patch fixes the issue. With it VACUUM deletes orphaned tables in 
> single mode.

This seems like an astonishingly bad idea.  Nobody would expect DROP TABLE
to be spelled "VACUUM", and the last thing we need when someone has been
forced to use single-user mode is to put additional land mines under their
feet.  They might, for example, wish to do forensic investigation on such
tables to discover the reason for a crash.

I wonder if a better response would be, in single-user mode, to allow temp
tables to be processed as local temp tables regardless of their backend
number.  (Everywhere, not just in VACUUM.)

Also, if what someone actually wants is to drop such a temp table from
single-user mode, we should make sure that they are allowed to do so.
But the command for doing that should be "DROP TABLE", not "VACUUM".

            regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Protect syscache from bloating with negative cache entries
Next
From: Tomas Vondra
Date:
Subject: Re: Protect syscache from bloating with negative cache entries