pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christoph Berg <myon@debian.org>
To: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15061: Cannot use TEMP TABLE ON COMMIT DROP in extension
Date: Thu, 22 Feb 2018 10:41:52 +0100
Message-ID: <20180222094152.GA16878@msg.df7cb.de> (raw)
In-Reply-To: <20180213052732.GF2915@paquier.xyz>
References: <151845695673.1447.1976587386911561582@wrigleys.postgresql.org>
	<20180213052732.GF2915@paquier.xyz>

Re: Michael Paquier 2018-02-13 <20180213052732.GF2915@paquier.xyz>
> > 1) Explicitly drop the table within the .control file
> > 2) Don't use ON COMMIT DROP (but that leaks the temp tables to the invoking
> > session)
> 
> One dirty trick I can think of here is to directly delete
> the dependency within pg_depend, say in your extension script:
> create temp table aa (a int);
> delete from pg_depend where objid = 'aa'::regclass and refclassid = 'pg_extension'::regclass;

"drop table aa" is much easier and cleaner anyway.

> Have you actually thought about using unlogged tables?  Keeping around
> relation definitions is not a big deal usually for upgrade scenarios,
> and temporary tables generate WAL, so if you move your data with a
> two-step process you never want to generate the same WAL data twice,
> making the upgrade perform faster.

The table is only about 3000 rows, so speed is not a concern.

Christoph




view thread (3+ messages)

Message-ID: <20180222094152.GA16878@msg.df7cb.de>
Permalink:  ../20180222094152.GA16878@msg.df7cb.de/
Also on:    postgresql.org/message-id/20180222094152.GA16878@msg.df7cb.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: myon@debian.org, michael@paquier.xyz
  Subject: Re: BUG #15061: Cannot use TEMP TABLE ON COMMIT DROP in extension
  In-Reply-To: <20180222094152.GA16878@msg.df7cb.de>
  References: <151845695673.1447.1976587386911561582@wrigleys.postgresql.org> <20180213052732.GF2915@paquier.xyz> <20180222094152.GA16878@msg.df7cb.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