Re: [BUGS] General Bug Report: TEMP TABLES becomes permanent CATALOG TABLES

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: Ricardo Coelho <rcoelho(at)px(dot)com(dot)br>
Cc: Bugs for PostgreSQL <bugs(at)postgreSQL(dot)org>
Subject: Re: [BUGS] General Bug Report: TEMP TABLES becomes permanent CATALOG TABLES
Date: 1999-07-02 18:06:31
Message-ID: 199907021806.OAA12194@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> > Test Case:
> > ----------
> > psql mydb
> > mydb=> select * into temp table TMP from anytable;
> > mydb=> drop table invalidTable;
> > mydb=> \q
> > psql mydb
> > mydb=> \dS --> You will see a new permanent system table.
>
> I can confirm that this a bug. I am looking at it now. As a
> workaround, you can delete the temp tables by starting a postgres
> backend with the -O flag to allow system table modifications, and
> droping the table.

OK, I have fixed the problem, and the patch is attached. The fix will
appear in 6.5.1, due out in mid-July.

The problem is that the temp tables are removed on exit, but they were
not given their own transaction, and were executed in the last
transaction of the session. If that last session was aborted, the
entries were not being removed from pg_class.

If anyone thinks doing a transaction on exit is a bad idea, please let
me know.

--
Bruce Momjian | http://www.op.net/~candle
maillist(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 4.9 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Göran Uddeborg 1999-07-02 22:18:56
Previous Message Bruce Momjian 1999-07-02 04:29:10 Re: [BUGS] General Bug Report: TEMP TABLES becomes permanent CATALOG TABLES