postgresql/src/backend/commands
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
..
Makefile Refactor backend makefiles to remove lots of duplicate code 2008-02-19 10:30:09 +00:00
aggregatecmds.c ALTER AGGREGATE OWNER seems to have been missed by the last couple of 2008-06-08 21:09:48 +00:00
alter.c Rearrange ALTER TABLE syntax processing as per my recent proposal: the 2008-06-15 01:25:54 +00:00
analyze.c Move exprType(), exprTypmod(), expression_tree_walker(), and related routines 2008-08-25 22:42:34 +00:00
async.c Fix the raw-parsetree representation of star (as in SELECT * FROM or 2008-08-30 01:39:14 +00:00
cluster.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
comment.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
conversioncmds.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
copy.c Improve snapshot manager by keeping explicit track of snapshots. 2008-05-12 20:02:02 +00:00
dbcommands.c Improve CREATE/DROP/RENAME DATABASE so that when failing because the source 2008-08-04 18:03:46 +00:00
define.c Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
discard.c Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
explain.c Cause the output from debug_print_parse, debug_print_rewritten, and 2008-08-19 18:30:04 +00:00
functioncmds.c Implement SQL-spec RETURNS TABLE syntax for functions. 2008-07-18 03:32:53 +00:00
indexcmds.c Move exprType(), exprTypmod(), expression_tree_walker(), and related routines 2008-08-25 22:42:34 +00:00
lockcmds.c Create a separate grantable privilege for TRUNCATE, rather than having it be 2008-09-08 00:47:41 +00:00
opclasscmds.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
operatorcmds.c Clean up the loose ends in selectivity estimation left by my patch for semi 2008-08-16 00:01:38 +00:00
portalcmds.c Adjust things so that the query_string of a cached plan and the sourceText of 2008-07-18 20:26:06 +00:00
prepare.c Extend the parser location infrastructure to include a location field in 2008-08-28 23:09:48 +00:00
proclang.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
schemacmds.c Refactor the handling of the various DropStmt variants so that when multiple 2008-06-14 18:04:34 +00:00
sequence.c Clean up the use of some page-header-access macros: principally, use 2008-07-13 20:45:47 +00:00
tablecmds.c Create a separate grantable privilege for TRUNCATE, rather than having it be 2008-09-08 00:47:41 +00:00
tablespace.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
trigger.c Add a bunch of new error location reports to parse-analysis error messages. 2008-09-01 20:42:46 +00:00
tsearchcmds.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
typecmds.c Extend the parser location infrastructure to include a location field in 2008-08-28 23:09:48 +00:00
user.c Restructure some header files a bit, in particular heapam.h, by removing some 2008-05-12 00:00:54 +00:00
vacuum.c Initialize the minimum frozen Xid in vac_update_datfrozenxid using 2008-09-11 14:01:10 +00:00
vacuumlazy.c Restructure some header files a bit, in particular heapam.h, by removing some 2008-05-12 00:00:54 +00:00
variable.c Improve snapshot manager by keeping explicit track of snapshots. 2008-05-12 20:02:02 +00:00
view.c Move exprType(), exprTypmod(), expression_tree_walker(), and related routines 2008-08-25 22:42:34 +00:00