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

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
Cc: Ricardo Coelho <rcoelho(at)px(dot)com(dot)br>, pgsql-bugs(at)postgreSQL(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: [BUGS] General Bug Report: TEMP TABLES becomes permanent CATALOG TABLES
Date: 1999-07-02 04:29:10
Message-ID: 199907020429.AAA21384@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> OK, I have looked at the problem, and found a few things. First, if you
> look in data/base/dbname, you will see the actual temp files are not
> there. The only place they exist after psql exit is in pg_class.
>
> Second, I found that if I do:
>
> select * into temp xx from yy;
> drop table badname;
> select * into temp xxe from yy;
>
> it does not leave around the temp tables, but it if I add a second drop,
> it fails again, so it appears that I have to exit on a bad command to
> have the entries left around. Just issuing the select without the bad
> command cleans up properly, so I am left to believe that the failed
> command is doing something strange. My guess is that somehow the dirty
> marks on buffers is getting cleared by the bad command, and on exit, the
> new pg_class blocks are not getting put on disk.
>
> Tom Lane, you did the code that does special things when there is a
> failed command, right? It was because creating a table inside a failed
> transaction was leaving around the old cache entries. Could this be
> causing this problem?

I think I may know the cause. The at_exit removal of the temp tables is
taking place in a failed transaction. Let me test that idea tomorrow.

--
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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 1999-07-02 18:06:31 Re: [BUGS] General Bug Report: TEMP TABLES becomes permanent CATALOG TABLES
Previous Message Bruce Momjian 1999-07-02 04:03:11 Re: [BUGS] General Bug Report: TEMP TABLES becomes permanent CATALOG TABLES