Re: [GENERAL] Corrupt database? 8.1/FreeBSD6.0 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [GENERAL] Corrupt database? 8.1/FreeBSD6.0
Date
Msg-id 28018.1169139143@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] Corrupt database? 8.1/FreeBSD6.0  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Tom Lane wrote:
>> But it seems that we need a band-aid for 8.1 and earlier.  The simplest
>> fix I can think of is for vacuum not to attempt to advance the
>> datvacuumxid/datfrozenxid fields if it skipped over any temp tables of
>> other backends.  That's a bit nasty, since in a database making heavy
>> use of temp tables, you might do a whole lot of vacuums without ever
>> meeting that condition.  Anyone have a better idea?

> That seems nasty.  Can we examine the xmin of the pg_class entry for
> temp tables instead?

No, because any sort of schema update on the temp table would rewrite
its pg_class row with a newer version.  You couldn't assume that the
pg_class row is older than what's in the table.  Consider this perfectly
reasonable scenario:

    CREATE TEMP TABLE foo ...
    COPY foo FROM ...
    CREATE INDEX ...        <- must set relhasindex


            regards, tom lane

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [GENERAL] Corrupt database? 8.1/FreeBSD6.0
Next
From: Teodor Sigaev
Date:
Subject: Re: Design notes for EquivalenceClasses