PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
snapshot.h File Reference
#include "lib/pairingheap.h"
Include dependency graph for snapshot.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SnapshotData
 

Macros

#define InvalidSnapshot   ((Snapshot) NULL)
 

Typedefs

typedef enum SnapshotType SnapshotType
 
typedef struct SnapshotDataSnapshot
 
typedef struct SnapshotData SnapshotData
 

Enumerations

enum  SnapshotType {
  SNAPSHOT_MVCC = 0 , SNAPSHOT_SELF , SNAPSHOT_ANY , SNAPSHOT_TOAST ,
  SNAPSHOT_DIRTY , SNAPSHOT_HISTORIC_MVCC , SNAPSHOT_NON_VACUUMABLE
}
 

Macro Definition Documentation

◆ InvalidSnapshot

#define InvalidSnapshot   ((Snapshot) NULL)

Definition at line 119 of file snapshot.h.

Typedef Documentation

◆ Snapshot

typedef struct SnapshotData* Snapshot

Definition at line 117 of file snapshot.h.

◆ SnapshotData

typedef struct SnapshotData SnapshotData

◆ SnapshotType

typedef enum SnapshotType SnapshotType

Enumeration Type Documentation

◆ SnapshotType

Enumerator
SNAPSHOT_MVCC 
SNAPSHOT_SELF 
SNAPSHOT_ANY 
SNAPSHOT_TOAST 
SNAPSHOT_DIRTY 
SNAPSHOT_HISTORIC_MVCC 
SNAPSHOT_NON_VACUUMABLE 

Definition at line 31 of file snapshot.h.

32{
33 /*-------------------------------------------------------------------------
34 * A tuple is visible iff the tuple is valid for the given MVCC snapshot.
35 *
36 * Here, we consider the effects of:
37 * - all transactions committed as of the time of the given snapshot
38 * - previous commands of this transaction
39 *
40 * Does _not_ include:
41 * - transactions shown as in-progress by the snapshot
42 * - transactions started after the snapshot was taken
43 * - changes made by the current command
44 * -------------------------------------------------------------------------
45 */
46 SNAPSHOT_MVCC = 0,
47
48 /*-------------------------------------------------------------------------
49 * A tuple is visible iff the tuple is valid "for itself".
50 *
51 * Here, we consider the effects of:
52 * - all committed transactions (as of the current instant)
53 * - previous commands of this transaction
54 * - changes made by the current command
55 *
56 * Does _not_ include:
57 * - in-progress transactions (as of the current instant)
58 * -------------------------------------------------------------------------
59 */
61
62 /*
63 * Any tuple is visible.
64 */
66
67 /*
68 * A tuple is visible iff the tuple is valid as a TOAST row.
69 */
71
72 /*-------------------------------------------------------------------------
73 * A tuple is visible iff the tuple is valid including effects of open
74 * transactions.
75 *
76 * Here, we consider the effects of:
77 * - all committed and in-progress transactions (as of the current instant)
78 * - previous commands of this transaction
79 * - changes made by the current command
80 *
81 * This is essentially like SNAPSHOT_SELF as far as effects of the current
82 * transaction and committed/aborted xacts are concerned. However, it
83 * also includes the effects of other xacts still in progress.
84 *
85 * A special hack is that when a snapshot of this type is used to
86 * determine tuple visibility, the passed-in snapshot struct is used as an
87 * output argument to return the xids of concurrent xacts that affected
88 * the tuple. snapshot->xmin is set to the tuple's xmin if that is
89 * another transaction that's still in progress; or to
90 * InvalidTransactionId if the tuple's xmin is committed good, committed
91 * dead, or my own xact. Similarly for snapshot->xmax and the tuple's
92 * xmax. If the tuple was inserted speculatively, meaning that the
93 * inserter might still back down on the insertion without aborting the
94 * whole transaction, the associated token is also returned in
95 * snapshot->speculativeToken. See also InitDirtySnapshot().
96 * -------------------------------------------------------------------------
97 */
99
100 /*
101 * A tuple is visible iff it follows the rules of SNAPSHOT_MVCC, but
102 * supports being called in timetravel context (for decoding catalog
103 * contents in the context of logical decoding).
104 */
106
107 /*
108 * A tuple is visible iff the tuple might be visible to some transaction;
109 * false if it's surely dead to everyone, i.e., vacuumable.
110 *
111 * For visibility checks snapshot->min must have been set up with the xmin
112 * horizon to use.
113 */
SnapshotType
Definition: snapshot.h:32
@ SNAPSHOT_TOAST
Definition: snapshot.h:70
@ SNAPSHOT_SELF
Definition: snapshot.h:60
@ SNAPSHOT_NON_VACUUMABLE
Definition: snapshot.h:114
@ SNAPSHOT_MVCC
Definition: snapshot.h:46
@ SNAPSHOT_ANY
Definition: snapshot.h:65
@ SNAPSHOT_HISTORIC_MVCC
Definition: snapshot.h:105
@ SNAPSHOT_DIRTY
Definition: snapshot.h:98