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

From Robert Haas
Subject Re: [PROPOSAL] Drop orphan temp tables in single-mode
Date
Msg-id CA+TgmoZZ0qSCaNyRrd1H2mYP8Cjr-+YA--T8ewXTeaH1cpAvYg@mail.gmail.com
Whole thread Raw
In response to Re: [PROPOSAL] Drop orphan temp tables in single-mode  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PROPOSAL] Drop orphan temp tables in single-mode
List pgsql-hackers
On Thu, Mar 7, 2019 at 9:40 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 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.)

Since commit debcec7dc31a992703911a9953e299c8d730c778 there is nothing
to prevent two different backends from using the same relfilenode
number, so I don't think this will work.

> 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".

In a way I agree, but I think the reality is that some very large
percentage of people who enter single user mode do so because of a
wraparound-induced shutdown, and what they need is an easy way to get
the system back on line.  Running a catalog query to look for
undropped temp tables and then dropping them one by one using DROP
TABLE is not what they want.  They want to be able to run one or two
commands and get their database back on line.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Alexander Kuzmenkov
Date:
Subject: Re: Optimze usage of immutable functions as relation
Next
From: Robert Haas
Date:
Subject: Re: Protect syscache from bloating with negative cache entries