postgresql/src
Alvaro Herrera d53a56687f Initialize the minimum frozen Xid in vac_update_datfrozenxid using
GetOldestXmin() instead of RecentGlobalXmin; this is safer because we do not
depend on the latter being correctly set elsewhere, and while it is more
expensive, this code path is not performance-critical.  This is a real
risk for autovacuum, because it can execute whole cycles without doing
a single vacuum, which would mean that RecentGlobalXmin would stay at its
initialization value, FirstNormalTransactionId, causing a bogus value to be
inserted in pg_database.  This bug could explain some recent reports of
failure to truncate pg_clog.

At the same time, change the initialization of RecentGlobalXmin to
InvalidTransactionId, and ensure that it's set to something else whenever
it's going to be used.  Using it as FirstNormalTransactionId in HOT page
pruning could incur in data loss.  InitPostgres takes care of setting it
to a valid value, but the extra checks are there to prevent "special"
backends from behaving in unusual ways.

Per Tom Lane's detailed problem dissection in 29544.1221061979@sss.pgh.pa.us
2008-09-11 14:01:10 +00:00
..
backend Initialize the minimum frozen Xid in vac_update_datfrozenxid using 2008-09-11 14:01:10 +00:00
bin Make pg_dump --data-only try to order the table dumps so that foreign keys' 2008-09-08 15:26:23 +00:00
include Make our parsing of INTERVAL literals spec-compliant (or at least a heck of 2008-09-10 18:29:41 +00:00
interfaces Avoid using sprintf() for a simple octal conversion in PQescapeByteaInternal. 2008-09-10 17:01:07 +00:00
makefiles Synchronize the shared object build rules in Makefile.port with Makefile.shlib 2008-09-01 08:50:10 +00:00
pl Fix a couple of places where the plpgsql grammar would produce an unhelpful 2008-09-10 01:09:45 +00:00
port Use CRITICAL_SECTION instead of Mutexes for thread-locking in libpq on 2008-05-21 14:20:48 +00:00
template Use SYSV semaphores rather than POSIX on Darwin >= 6.0 (i.e., OS X 10.2 2007-09-26 00:32:46 +00:00
test Make our parsing of INTERVAL literals spec-compliant (or at least a heck of 2008-09-10 18:29:41 +00:00
timezone Fix identify_system_timezone() so that it tests the behavior of the system 2008-07-01 03:40:55 +00:00
tools Add Win32 MSVC code to support this recent patch: 2008-09-05 16:54:39 +00:00
tutorial Add $PostgreSQL$ markers to a lot of files that were missing them. 2008-05-17 01:28:26 +00:00
bcc32.mak Remove old-style win32 client-only visual c++ build infrastructure for everything except 2007-03-05 14:18:38 +00:00
DEVELOPERS Testing commit stuff 2006-07-10 15:50:02 +00:00
Makefile Catch all errors in for and while loops in makefiles. Don't ignore any 2008-03-18 16:24:50 +00:00
Makefile.global.in Code coverage testing with gcov. Documentation is in the regression test 2008-09-05 12:11:18 +00:00
Makefile.shlib Synchronize the shared object build rules in Makefile.port with Makefile.shlib 2008-09-01 08:50:10 +00:00
nls-global.mk Another fix for compiles on an empty 'po' directory. 2008-05-17 21:27:12 +00:00
win32.mak Update supported standalone VC++ version to 7.1+ only, and fix 2007-08-03 10:47:11 +00:00