digoal@126.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