Re: BUG #14042: bug, PostgreSQL not cleanup temp table info after crash.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: digoal(at)126(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14042: bug, PostgreSQL not cleanup temp table info after crash.
Date: 2016-03-24 14:03:52
Message-ID: 22423.1458828232@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

digoal(at)126(dot)com writes:
> When PostgreSQL crashed during database have temp table, database not
> cleanup the temp table's info in pg_class.

This behavior is intentional.

> and there is some bad thing, if no one create the same name temp table after
> restart. this temp table will a zombie in pg_class, and vacuum freeze cann't
> reduce it's age and database's age.

This is not a problem, see the code in autovacuum.c:

/*
* We found an orphan temp table (which was probably left
* behind by a crashed backend). If it's so old as to need
* vacuum for wraparound, forcibly drop it. Otherwise just
* log a complaint.
*/

In practice, such tables will go away the next time some session uses the
temp schema containing them, so their lifespan isn't likely to be nearly
long enough for this code to activate. But in any case, they won't create
a wraparound hazard.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2016-03-24 14:14:06 Re: Re: Missing rows with index scan when collation is not "C" (PostgreSQL 9.5)
Previous Message Reko Turja 2016-03-24 14:02:08 Re: Missing rows with index scan when collation is not "C" (PostgreSQL 9.5);