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
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-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

Attachment Content-Type Size
unknown_filename text/plain 8.1 KB

Responses

Browse pgsql-hackers by date

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

Browse pgsql-patches by date

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