pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: removal of dangling temp tables
Date: Fri, 14 Dec 2018 13:35:50 -0500
Message-ID: <9969.1544812550@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoaU-rRTOsYy9o6nj6h58tg49dhUd0u3XFGJ_GvdOFLmZw@mail.gmail.com>
References: <20181214162843.37g6h3txto43akrb@alvherre.pgsql>
	<CA+TgmoYdgL7pRBAkucZoZriVExJvS+TqGZ7yZNF0roi7FiHwLA@mail.gmail.com>
	<8545.1544810243@sss.pgh.pa.us>
	<CA+TgmoaU-rRTOsYy9o6nj6h58tg49dhUd0u3XFGJ_GvdOFLmZw@mail.gmail.com>

Robert Haas <robertmhaas@gmail.com> writes:
> On Fri, Dec 14, 2018 at 12:57 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I seem to recall discussions about having crash recovery go around
>> and clean out temp tables.  That seems like a better plan than
>> penalizing every session start with this.

> Well, crash recovery already removes the files, but it can't really
> remove the catalog entries, can it?

Hm.  It *could*, if we wanted it to run some transactions after
finishing recovery.  But I guess I wonder why bother; if the disk
space is gone then there's not that much reason to be in a hurry
to get rid of the catalog entries.  The particular problem Alvaro
is complaining of might be better handled by ignoring temp tables
while computing max freeze age etc.  I have some recollection that
we'd intentionally included them, but I wonder why really; it's
not like autovacuum is going to be able to do anything about an
ancient temp table.

Alternatively, maybe we could have backends flag whether they've
taken ownership of their temp schemas or not, and let autovacuum
flush old temp tables if not?

			regards, tom lane




view thread (29+ messages)  latest in thread

Message-ID: <9969.1544812550@sss.pgh.pa.us>
Permalink:  ../9969.1544812550@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9969.1544812550@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, alvherre@2ndquadrant.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: removal of dangling temp tables
  In-Reply-To: <9969.1544812550@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox