pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Thierry Husson <thusson@informiciel.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Temp table handling after anti-wraparound shutdown (Was: BUG #15840)
Date: Sun, 9 Jun 2019 14:31:26 -0700
Message-ID: <20190609213126.uutlkqlrsud3bdfs@alap3.anarazel.de> (raw)
In-Reply-To: <20190608040639.Horde.mXgiHVLprn9sAsYXLi6I9up@webmail.iciel.com>
References: <15840-06c9565bfd8099f6@postgresql.org>
	<20190607190231.6psb6w3bvlod7lvk@alap3.anarazel.de>
	<20190607145911.Horde.MKizKAnShw4nKEYGDUC2M-T@webmail.iciel.com>
	<20190607201002.cado5goe3rcup43n@alap3.anarazel.de>
	<20190607164027.Horde._egTUMJMTDBA4f31sPYgl_J@webmail.iciel.com>
	<20190607225843.z73jqqyy6hhc6qnp@alap3.anarazel.de>
	<20190607235937.GA1590@paquier.xyz>
	<20190608002632.ptuvc6tbffjhlsgi@alap3.anarazel.de>
	<20190608014540.GC7228@paquier.xyz>
	<20190608040639.Horde.mXgiHVLprn9sAsYXLi6I9up@webmail.iciel.com>

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





view thread (10+ messages)  latest in thread

Message-ID: <20190609213126.uutlkqlrsud3bdfs@alap3.anarazel.de>
Permalink:  ../20190609213126.uutlkqlrsud3bdfs@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20190609213126.uutlkqlrsud3bdfs@alap3.anarazel.de

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: andres@anarazel.de, thusson@informiciel.com, michael@paquier.xyz, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
  Subject: Re: Temp table handling after anti-wraparound shutdown (Was: BUG #15840)
  In-Reply-To: <20190609213126.uutlkqlrsud3bdfs@alap3.anarazel.de>
  References: <15840-06c9565bfd8099f6@postgresql.org> <20190607190231.6psb6w3bvlod7lvk@alap3.anarazel.de> <20190607145911.Horde.MKizKAnShw4nKEYGDUC2M-T@webmail.iciel.com> <20190607201002.cado5goe3rcup43n@alap3.anarazel.de> <20190607164027.Horde._egTUMJMTDBA4f31sPYgl_J@webmail.iciel.com> <20190607225843.z73jqqyy6hhc6qnp@alap3.anarazel.de> <20190607235937.GA1590@paquier.xyz> <20190608002632.ptuvc6tbffjhlsgi@alap3.anarazel.de> <20190608014540.GC7228@paquier.xyz> <20190608040639.Horde.mXgiHVLprn9sAsYXLi6I9up@webmail.iciel.com> <20190609213126.uutlkqlrsud3bdfs@alap3.anarazel.de>

* 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