mirror of
https://github.com/postgres/postgres.git
synced 2025-08-21 10:42:50 +03:00
Have CLUSTER advance the table's relfrozenxid. The new frozen point is the
FreezeXid introduced in a recent commit, so there isn't any data loss in this approach. Doing it causes ALTER TABLE (or rather, the forms of it that cause a full table rewrite) to be affected as well. In this case, the frozen point is RecentXmin, because after the rewrite all the tuples are relabeled with the rewriting transaction's Xid. TOAST tables are fixed automatically as well, as fallout of the way they were already being handled in the respective code paths. With this patch, there is no longer need to VACUUM tables for Xid wraparound purposes that have been cleaned up via TRUNCATE or CLUSTER.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994-5, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/commands/cluster.h,v 1.32 2007/03/13 00:33:43 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/include/commands/cluster.h,v 1.33 2007/05/18 23:19:42 alvherre Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -24,6 +24,6 @@ extern void check_index_is_clusterable(Relation OldHeap, Oid indexOid,
|
||||
extern void mark_index_clustered(Relation rel, Oid indexOid);
|
||||
extern Oid make_new_heap(Oid OIDOldHeap, const char *NewName,
|
||||
Oid NewTableSpace);
|
||||
extern void swap_relation_files(Oid r1, Oid r2);
|
||||
extern void swap_relation_files(Oid r1, Oid r2, TransactionId frozenXid);
|
||||
|
||||
#endif /* CLUSTER_H */
|
||||
|
Reference in New Issue
Block a user