Skip site navigation (1) Skip section navigation (2)

Removal of temp tables

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Removal of temp tables
Date: 2001-06-14 04:17:14
Message-ID: 200106140417.f5E4HEn06854@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Here is a patch that allows people to delete the pg_temp* tables used as
temp tables.  They are left around after a backend crash and the only
way previously to remove them was to start postgres with the -O override
option.

I am wondering if pg_temp tables should even be seen as system tables by
IsSystemRelationName().  We have to call them pg_ so user applications
don't display them, but other than that they aren't like system tables.
Comments?

There are no tests to see if the table is actually in use.  I can add
them if people want it.

---------------------------------------------------------------------------
	
	test=> CREATE TEMP TABLE test (x int);
	CREATE
	test=> \dS
	          List of relations
	      Name      |  Type   |  Owner   
	----------------+---------+----------
	...
	 pg_temp.6682.0 | table   | postgres
	...
	test=> DROP TABLE "pg_temp.6682.0";
	DROP

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2001-06-14 04:23:51
Subject: Re: corrupted document in 7.1.2
Previous:From: Dave CramerDate: 2001-06-14 03:34:04
Subject: Row Versioning, for jdbc updateable result sets

pgsql-patches by date

Next:From: Tom LaneDate: 2001-06-14 04:52:06
Subject: Re: Removal of temp tables
Previous:From: Bruce MomjianDate: 2001-06-14 02:52:59
Subject: Re: [HACKERS] Re: Fw: Isn't pg_statistic a security hole - Solution Proposal

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group