Re: [PROPOSAL] Drop orphan temp tables in single-mode

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Arthur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Grigory Smolkin <g(dot)smolkin(at)postgrespro(dot)ru>
Subject: Re: [PROPOSAL] Drop orphan temp tables in single-mode
Date: 2019-03-07 14:53:16
Message-ID: CA+TgmoZZ0qSCaNyRrd1H2mYP8Cjr-+YA--T8ewXTeaH1cpAvYg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Mar 7, 2019 at 9:40 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2019-03-07 15:01:37 Re: Protect syscache from bloating with negative cache entries
Previous Message Alexander Kuzmenkov 2019-03-07 14:52:59 Re: Optimze usage of immutable functions as relation