Thread

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

    Bruce Momjian <maillist@candle.pha.pa.us> — 1999-07-02T18:06:31Z

    > > 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@candle.pha.pa.us            |  (610) 853-3000
      +  If your life is a hard drive,     |  830 Blythe Avenue
      +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026