mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-14 10:27:04 +08:00
"all tuples visible" flag in heap page headers. The flag update *must* be applied before calling XLogInsert, but heap_update and the tuple moving routines in VACUUM FULL were ignoring this rule. A crash and replay could therefore leave the flag incorrectly set, causing rows to appear visible in seqscans when they should not be. This might explain recent reports of data corruption from Jeff Ross and others. In passing, do a bit of editorialization on comments in visibilitymap.c.
31 lines
1.0 KiB
C
31 lines
1.0 KiB
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* visibilitymap.h
|
|
* visibility map interface
|
|
*
|
|
*
|
|
* Portions Copyright (c) 2007-2009, PostgreSQL Global Development Group
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
*
|
|
* $PostgreSQL: pgsql/src/include/access/visibilitymap.h,v 1.5 2009/08/24 02:18:32 tgl Exp $
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef VISIBILITYMAP_H
|
|
#define VISIBILITYMAP_H
|
|
|
|
#include "access/xlogdefs.h"
|
|
#include "storage/block.h"
|
|
#include "storage/buf.h"
|
|
#include "utils/relcache.h"
|
|
|
|
extern void visibilitymap_clear(Relation rel, BlockNumber heapBlk);
|
|
extern void visibilitymap_pin(Relation rel, BlockNumber heapBlk,
|
|
Buffer *vmbuf);
|
|
extern void visibilitymap_set(Relation rel, BlockNumber heapBlk,
|
|
XLogRecPtr recptr, Buffer *vmbuf);
|
|
extern bool visibilitymap_test(Relation rel, BlockNumber heapBlk, Buffer *vmbuf);
|
|
extern void visibilitymap_truncate(Relation rel, BlockNumber heapblk);
|
|
|
|
#endif /* VISIBILITYMAP_H */
|