pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: jboes@nexcerpt.com
Cc: pgsql-admin@postgresql.org
Subject: Re: Leftover TEMPORARY tables?
Date: Wed, 23 Apr 2003 23:51:07 -0400
Message-ID: <10774.1051156267@sss.pgh.pa.us> (raw)
In-Reply-To: <d40a65a1.0304230902.570c9a84@posting.google.com>
References: <d40a65a1.0304230902.570c9a84@posting.google.com>

jboes@nexcerpt.com (Jeff Boes) writes:
> I just noticed that there are a number of tables in our schema with
> names fo the form pg_temp_*; these correspond to temporary tables
> created by our application, but they shouldn't still exist. Under what
> circumstances would a temporary table become permanent?

In theory, never.  Do you have frequent backend crashes?  Is it possible
that the backend sessions that created these tables are actually still
running?

If you're quite certain that the sessions that created those tables are
dead, it is safe to issue DROPs against them.  I am not sure whether you
have to jump through any hoops to do so though --- the protection
checks against dropping system tables look for "pg_XXX" and so are
likely to mutiny :-(.  You might need to run a standalone backend with
the -O command-line switch to get around that protection check.

PG 7.3 handles this scenario a little better, but I take it you haven't
upgraded yet ...

			regards, tom lane




view thread (11+ messages)  latest in thread

Message-ID: <10774.1051156267@sss.pgh.pa.us>
Permalink:  ../10774.1051156267@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10774.1051156267@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 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-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jboes@nexcerpt.com
  Subject: Re: Leftover TEMPORARY tables?
  In-Reply-To: <10774.1051156267@sss.pgh.pa.us>
  References: <d40a65a1.0304230902.570c9a84@posting.google.com> <10774.1051156267@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