Re: Min Xid problem proposal - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Min Xid problem proposal
Date
Msg-id 29507.1134149541@sss.pgh.pa.us
Whole thread Raw
In response to Min Xid problem proposal  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: Min Xid problem proposal
Re: Min Xid problem proposal
List pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> My proposal to solve that problem, is to make any transaction that
> inserts or modifies tuples in a table that is marked as frozen, unfreeze
> it first.  The problem I had last time was finding a good spot in the
> code for doing so.  I'm now proposing to do it in the parser, in
> setTargetTable().

My god, no.  Do you have any idea how many paths for updates you've missed?
(Think about prepared plans for starters.)

Furthermore, you can't do this in the way you propose (non-WAL-logged
update to pg_class).  What if the system crashes without ever having
written this update to disk?  The inserted tuples might have made it ---
whether they're committed or not doesn't matter, you've still blown it.

I don't see any very good argument for allowing this mechanism to set
minxid = FrozenXid in the first place.  If there are only frozenXid in
the table, set minxid = current XID.  That eliminates the entire problem
at a stroke.

(Yes, I know what you are going to say.  The idea of freezing a table
and then never having to vacuum it at all is NOT worth the cost of
putting in a mechanism that would guarantee its safety.)
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Log of CREATE USER statement
Next
From: Peter Eisentraut
Date:
Subject: Re: Log of CREATE USER statement