00001 /*------------------------------------------------------------------------- 00002 * 00003 * snapmgr.h 00004 * POSTGRES snapshot manager 00005 * 00006 * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group 00007 * Portions Copyright (c) 1994, Regents of the University of California 00008 * 00009 * src/include/utils/snapmgr.h 00010 * 00011 *------------------------------------------------------------------------- 00012 */ 00013 #ifndef SNAPMGR_H 00014 #define SNAPMGR_H 00015 00016 #include "fmgr.h" 00017 #include "utils/resowner.h" 00018 #include "utils/snapshot.h" 00019 00020 00021 extern bool FirstSnapshotSet; 00022 00023 extern TransactionId TransactionXmin; 00024 extern TransactionId RecentXmin; 00025 extern TransactionId RecentGlobalXmin; 00026 00027 extern Snapshot GetTransactionSnapshot(void); 00028 extern Snapshot GetLatestSnapshot(void); 00029 extern void SnapshotSetCommandId(CommandId curcid); 00030 00031 extern void PushActiveSnapshot(Snapshot snapshot); 00032 extern void PushCopiedSnapshot(Snapshot snapshot); 00033 extern void UpdateActiveSnapshotCommandId(void); 00034 extern void PopActiveSnapshot(void); 00035 extern Snapshot GetActiveSnapshot(void); 00036 extern bool ActiveSnapshotSet(void); 00037 00038 extern Snapshot RegisterSnapshot(Snapshot snapshot); 00039 extern void UnregisterSnapshot(Snapshot snapshot); 00040 extern Snapshot RegisterSnapshotOnOwner(Snapshot snapshot, ResourceOwner owner); 00041 extern void UnregisterSnapshotFromOwner(Snapshot snapshot, ResourceOwner owner); 00042 00043 extern void AtSubCommit_Snapshot(int level); 00044 extern void AtSubAbort_Snapshot(int level); 00045 extern void AtEOXact_Snapshot(bool isCommit); 00046 00047 extern Datum pg_export_snapshot(PG_FUNCTION_ARGS); 00048 extern void ImportSnapshot(const char *idstr); 00049 extern bool XactHasExportedSnapshots(void); 00050 extern void DeleteAllExportedSnapshotFiles(void); 00051 extern bool ThereAreNoPriorRegisteredSnapshots(void); 00052 00053 #endif /* SNAPMGR_H */