56 #include "utils/fmgroids.h"
152 bool skip_locked =
false;
156 bool disable_page_skipping =
false;
157 bool process_main =
true;
158 bool process_toast =
true;
160 bool skip_database_stats =
false;
161 bool only_database_stats =
false;
187 if (strcmp(opt->
defname,
"verbose") == 0)
189 else if (strcmp(opt->
defname,
"skip_locked") == 0)
191 else if (strcmp(opt->
defname,
"buffer_usage_limit") == 0)
195 char *vac_buffer_size;
208 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
209 errmsg(
"BUFFER_USAGE_LIMIT option must be 0 or between %d kB and %d kB",
211 hintmsg ?
errhint(
"%s",
_(hintmsg)) : 0));
218 (
errcode(ERRCODE_SYNTAX_ERROR),
223 else if (strcmp(opt->
defname,
"analyze") == 0)
225 else if (strcmp(opt->
defname,
"freeze") == 0)
227 else if (strcmp(opt->
defname,
"full") == 0)
229 else if (strcmp(opt->
defname,
"disable_page_skipping") == 0)
231 else if (strcmp(opt->
defname,
"index_cleanup") == 0)
247 else if (strcmp(opt->
defname,
"process_main") == 0)
249 else if (strcmp(opt->
defname,
"process_toast") == 0)
251 else if (strcmp(opt->
defname,
"truncate") == 0)
253 else if (strcmp(opt->
defname,
"parallel") == 0)
255 if (opt->
arg == NULL)
258 (
errcode(ERRCODE_SYNTAX_ERROR),
259 errmsg(
"parallel option requires a value between 0 and %d",
270 (
errcode(ERRCODE_SYNTAX_ERROR),
271 errmsg(
"parallel workers for vacuum must be between 0 and %d",
285 else if (strcmp(opt->
defname,
"skip_database_stats") == 0)
287 else if (strcmp(opt->
defname,
"only_database_stats") == 0)
291 (
errcode(ERRCODE_SYNTAX_ERROR),
317 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
318 errmsg(
"VACUUM FULL cannot be performed in parallel")));
328 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
329 errmsg(
"BUFFER_USAGE_LIMIT cannot be specified for VACUUM FULL")));
336 foreach(lc, vacstmt->
rels)
342 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
343 errmsg(
"ANALYZE option must be specified when a column list is provided")));
354 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
355 errmsg(
"VACUUM option DISABLE_PAGE_SKIPPING cannot be used with FULL")));
361 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
362 errmsg(
"PROCESS_TOAST required with VACUUM FULL")));
370 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
371 errmsg(
"ONLY_DATABASE_STATS cannot be specified with a list of tables")));
379 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
380 errmsg(
"ONLY_DATABASE_STATS cannot be specified with other VACUUM options")));
449 vacuum(vacstmt->
rels, ¶ms, bstrategy, vac_context, isTopLevel);
481 static bool in_vacuum =
false;
483 const char *stmttype;
484 volatile bool in_outer_xact,
502 in_outer_xact =
false;
514 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
515 errmsg(
"%s cannot be executed from VACUUM or ANALYZE",
527 else if (relations !=
NIL)
532 foreach(lc, relations)
563 use_own_xacts =
true;
568 use_own_xacts =
true;
569 else if (in_outer_xact)
570 use_own_xacts =
false;
572 use_own_xacts =
true;
574 use_own_xacts =
false;
613 foreach(
cur, relations)
637 vrel->
va_cols, in_outer_xact, bstrategy);
718 !reltuple->relisshared) ||
727 (
errmsg(
"permission denied to vacuum \"%s\", skipping it",
740 (
errmsg(
"permission denied to analyze \"%s\", skipping it",
759 bool rel_lock =
true;
796 if (relation == NULL)
817 (
errcode(ERRCODE_LOCK_NOT_AVAILABLE),
818 errmsg(
"skipping vacuum of \"%s\" --- lock not available",
823 errmsg(
"skipping vacuum of \"%s\" --- relation no longer exists",
838 (
errcode(ERRCODE_LOCK_NOT_AVAILABLE),
839 errmsg(
"skipping analyze of \"%s\" --- lock not available",
844 errmsg(
"skipping analyze of \"%s\" --- relation no longer exists",
877 vacrels =
lappend(vacrels, vrel);
889 bool include_children;
890 bool is_partitioned_table;
918 (
errcode(ERRCODE_LOCK_NOT_AVAILABLE),
919 errmsg(
"skipping vacuum of \"%s\" --- lock not available",
923 (
errcode(ERRCODE_LOCK_NOT_AVAILABLE),
924 errmsg(
"skipping analyze of \"%s\" --- lock not available",
935 elog(
ERROR,
"cache lookup failed for relation %u", relid);
957 is_partitioned_table = (classForm->relkind == RELKIND_PARTITIONED_TABLE);
960 (
errmsg(
"VACUUM ONLY of partitioned table \"%s\" has no effect",
975 if (include_children)
980 foreach(part_lc, part_oids)
984 if (part_oid == relid)
1037 Oid relid = classForm->oid;
1044 if (classForm->relkind != RELKIND_RELATION &&
1045 classForm->relkind != RELKIND_MATVIEW &&
1046 classForm->relkind != RELKIND_PARTITIONED_TABLE)
1088 multixact_freeze_min_age,
1090 multixact_freeze_table_age,
1091 effective_multixact_freeze_max_age;
1094 aggressiveXIDCutoff;
1097 aggressiveMXIDCutoff;
1146 safeOldestMxact = nextMXID - effective_multixact_freeze_max_age;
1151 (
errmsg(
"cutoff for removing and freezing tuples is far in the past"),
1152 errhint(
"Close open transactions soon to avoid wraparound problems.\n"
1153 "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
1156 (
errmsg(
"cutoff for freezing multixacts is far in the past"),
1157 errhint(
"Close open transactions soon to avoid wraparound problems.\n"
1158 "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
1166 if (freeze_min_age < 0)
1169 Assert(freeze_min_age >= 0);
1185 if (multixact_freeze_min_age < 0)
1187 multixact_freeze_min_age =
Min(multixact_freeze_min_age,
1188 effective_multixact_freeze_max_age / 2);
1189 Assert(multixact_freeze_min_age >= 0);
1208 if (freeze_table_age < 0)
1211 Assert(freeze_table_age >= 0);
1212 aggressiveXIDCutoff = nextXID - freeze_table_age;
1216 aggressiveXIDCutoff))
1227 if (multixact_freeze_table_age < 0)
1229 multixact_freeze_table_age =
1230 Min(multixact_freeze_table_age,
1231 effective_multixact_freeze_max_age * 0.95);
1232 Assert(multixact_freeze_table_age >= 0);
1233 aggressiveMXIDCutoff = nextMXID - multixact_freeze_table_age;
1237 aggressiveMXIDCutoff))
1258 int skip_index_vacuum;
1317 double scanned_tuples)
1320 double old_rel_tuples = relation->
rd_rel->reltuples;
1322 double unscanned_pages;
1323 double total_tuples;
1326 if (scanned_pages >= total_pages)
1327 return scanned_tuples;
1343 if (old_rel_pages == total_pages &&
1344 scanned_pages < (
double) total_pages * 0.02)
1345 return old_rel_tuples;
1346 if (scanned_pages <= 1)
1347 return old_rel_tuples;
1353 if (old_rel_tuples < 0 || old_rel_pages == 0)
1354 return floor((scanned_tuples / scanned_pages) * total_pages + 0.5);
1362 old_density = old_rel_tuples / old_rel_pages;
1363 unscanned_pages = (double) total_pages - (
double) scanned_pages;
1364 total_tuples = old_density * unscanned_pages + scanned_tuples;
1365 return floor(total_tuples + 0.5);
1415 bool *frozenxid_updated,
bool *minmulti_updated,
1422 void *inplace_state;
1438 NULL, 1,
key, &ctup, &inplace_state);
1440 elog(
ERROR,
"pg_class entry for relid %u vanished during vacuuming",
1447 if (pgcform->relpages != (
int32) num_pages)
1449 pgcform->relpages = (
int32) num_pages;
1452 if (pgcform->reltuples != (
float4) num_tuples)
1454 pgcform->reltuples = (
float4) num_tuples;
1457 if (pgcform->relallvisible != (
int32) num_all_visible_pages)
1459 pgcform->relallvisible = (
int32) num_all_visible_pages;
1470 if (pgcform->relhasindex && !hasindex)
1472 pgcform->relhasindex =
false;
1477 if (pgcform->relhasrules && relation->
rd_rules == NULL)
1479 pgcform->relhasrules =
false;
1482 if (pgcform->relhastriggers && relation->
trigdesc == NULL)
1484 pgcform->relhastriggers =
false;
1499 oldfrozenxid = pgcform->relfrozenxid;
1501 if (frozenxid_updated)
1502 *frozenxid_updated =
false;
1505 bool update =
false;
1510 futurexid = update =
true;
1514 pgcform->relfrozenxid = frozenxid;
1516 if (frozenxid_updated)
1517 *frozenxid_updated =
true;
1522 oldminmulti = pgcform->relminmxid;
1524 if (minmulti_updated)
1525 *minmulti_updated =
false;
1528 bool update =
false;
1533 futuremxid = update =
true;
1537 pgcform->relminmxid = minmulti;
1539 if (minmulti_updated)
1540 *minmulti_updated =
true;
1555 errmsg_internal(
"overwrote invalid relfrozenxid value %u with new value %u for table \"%s\"",
1556 oldfrozenxid, frozenxid,
1561 errmsg_internal(
"overwrote invalid relminmxid value %u with new value %u for table \"%s\"",
1562 oldminmulti, minmulti,
1600 void *inplace_state;
1654 if (classForm->relkind != RELKIND_RELATION &&
1655 classForm->relkind != RELKIND_MATVIEW &&
1656 classForm->relkind != RELKIND_TOASTVALUE)
1691 newFrozenXid = relfrozenxid;
1705 newMinMulti = relminmxid;
1730 Anum_pg_database_oid,
1735 NULL, 1,
key, &tuple, &inplace_state);
1747 if (dbform->datfrozenxid != newFrozenXid &&
1751 dbform->datfrozenxid = newFrozenXid;
1755 newFrozenXid = dbform->datfrozenxid;
1758 if (dbform->datminmxid != newMinMulti &&
1762 dbform->datminmxid = newMinMulti;
1766 newMinMulti = dbform->datminmxid;
1783 lastSaneFrozenXid, lastSaneMinMulti);
1814 Oid oldestxid_datoid;
1815 Oid minmulti_datoid;
1817 bool frozenAlreadyWrapped =
false;
1866 "skipping invalid database \"%s\" while computing relfrozenxid",
1885 frozenAlreadyWrapped =
true;
1889 oldestxid_datoid = dbform->oid;
1895 minmulti_datoid = dbform->oid;
1909 if (frozenAlreadyWrapped)
1912 (
errmsg(
"some databases have not been vacuumed in over 2 billion transactions"),
1913 errdetail(
"You might have already suffered transaction-wraparound data loss.")));
1983 int save_sec_context;
2086 if (rel->
rd_rel->relkind != RELKIND_RELATION &&
2087 rel->
rd_rel->relkind != RELKIND_MATVIEW &&
2088 rel->
rd_rel->relkind != RELKIND_TOASTVALUE &&
2089 rel->
rd_rel->relkind != RELKIND_PARTITIONED_TABLE)
2092 (
errmsg(
"skipping \"%s\" --- cannot vacuum non-tables or special system tables",
2120 if (rel->
rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
2153 vacuum_index_cleanup =
2162 Assert(vacuum_index_cleanup ==
2190 toast_relid = rel->
rd_rel->reltoastrelid;
2268 memcpy(&toast_vacuum_params, params,
sizeof(
VacuumParams));
2272 vacuum_rel(toast_relid, NULL, &toast_vacuum_params, bstrategy);
2319 foreach(indexoidscan, indexoidlist)
2326 (*Irel)[
i++] = indrel;
2521 (
void *) dead_items);
2524 (
errmsg(
"scanned index \"%s\" to remove %lld row versions",
2526 (
long long) dead_items_info->
num_items)));
2543 (
errmsg(
"index \"%s\" now contains %.0f row versions in %u pages",
2547 errdetail(
"%.0f index row versions were removed.\n"
2548 "%u index pages were newly deleted.\n"
2549 "%u index pages are currently deleted, of which %u are currently reusable.",
bool object_ownercheck(Oid classid, Oid objectid, Oid roleid)
AclResult pg_class_aclcheck(Oid table_oid, Oid roleid, AclMode mode)
static uint32 pg_atomic_sub_fetch_u32(volatile pg_atomic_uint32 *ptr, int32 sub_)
static uint32 pg_atomic_add_fetch_u32(volatile pg_atomic_uint32 *ptr, int32 add_)
static uint32 pg_atomic_read_u32(volatile pg_atomic_uint32 *ptr)
void VacuumUpdateCosts(void)
int autovacuum_multixact_freeze_max_age
int autovacuum_freeze_max_age
void AutoVacuumUpdateCostLimit(void)
#define MAX_PARALLEL_WORKER_LIMIT
#define Assert(condition)
TransactionId MultiXactId
#define OidIsValid(objectId)
void TruncateCLOG(TransactionId oldestXact, Oid oldestxid_datoid)
void cluster_rel(Oid tableOid, Oid indexOid, ClusterParams *params)
void analyze_rel(Oid relid, RangeVar *relation, VacuumParams *params, List *va_cols, bool in_outer_xact, BufferAccessStrategy bstrategy)
void AdvanceOldestCommitTsXid(TransactionId oldestXact)
void TruncateCommitTs(TransactionId oldestXact)
bool database_is_invalid_form(Form_pg_database datform)
int32 defGetInt32(DefElem *def)
bool defGetBoolean(DefElem *def)
char * defGetString(DefElem *def)
int errmsg_internal(const char *fmt,...)
int errdetail(const char *fmt,...)
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
BufferAccessStrategy GetAccessStrategyWithSize(BufferAccessStrategyType btype, int ring_size_kb)
void systable_endscan(SysScanDesc sysscan)
void systable_inplace_update_cancel(void *state)
void systable_inplace_update_begin(Relation relation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, const ScanKeyData *key, HeapTuple *oldtupcopy, void **state)
void systable_inplace_update_finish(void *state, HeapTuple tuple)
HeapTuple systable_getnext(SysScanDesc sysscan)
SysScanDesc systable_beginscan(Relation heapRelation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, ScanKey key)
volatile sig_atomic_t InterruptPending
int VacuumBufferUsageLimit
bool parse_int(const char *value, int *result, int flags, const char **hintmsg)
int NewGUCNestLevel(void)
void RestrictSearchPath(void)
void AtEOXact_GUC(bool isCommit, int nestLevel)
#define GUC_check_errdetail
void ProcessConfigFile(GucContext context)
HeapTuple heap_getnext(TableScanDesc sscan, ScanDirection direction)
void heap_freetuple(HeapTuple htup)
#define HeapTupleIsValid(tuple)
IndexBulkDeleteResult * index_vacuum_cleanup(IndexVacuumInfo *info, IndexBulkDeleteResult *istat)
void index_close(Relation relation, LOCKMODE lockmode)
IndexBulkDeleteResult * index_bulk_delete(IndexVacuumInfo *info, IndexBulkDeleteResult *istat, IndexBulkDeleteCallback callback, void *callback_state)
Relation index_open(Oid relationId, LOCKMODE lockmode)
volatile sig_atomic_t ConfigReloadPending
List * lappend(List *list, void *datum)
void list_free(List *list)
List * list_concat(List *list1, const List *list2)
bool ConditionalLockRelationOid(Oid relid, LOCKMODE lockmode)
void UnlockRelationOid(Oid relid, LOCKMODE lockmode)
void LockRelationIdForSession(LockRelId *relid, LOCKMODE lockmode)
void UnlockRelationIdForSession(LockRelId *relid, LOCKMODE lockmode)
void LockDatabaseFrozenIds(LOCKMODE lockmode)
#define AccessExclusiveLock
#define ShareUpdateExclusiveLock
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
void LWLockRelease(LWLock *lock)
VacuumRelation * makeVacuumRelation(RangeVar *relation, Oid oid, List *va_cols)
void pfree(void *pointer)
void MemoryContextDelete(MemoryContext context)
MemoryContext PortalContext
#define AllocSetContextCreate
#define ALLOCSET_DEFAULT_SIZES
#define AmAutoVacuumWorkerProcess()
#define MIN_BAS_VAC_RING_SIZE_KB
#define MAX_BAS_VAC_RING_SIZE_KB
#define SECURITY_RESTRICTED_OPERATION
#define CHECK_FOR_INTERRUPTS()
void GetUserIdAndSecContext(Oid *userid, int *sec_context)
void SetUserIdAndSecContext(Oid userid, int sec_context)
bool MultiXactIdPrecedes(MultiXactId multi1, MultiXactId multi2)
bool MultiXactIdPrecedesOrEquals(MultiXactId multi1, MultiXactId multi2)
void SetMultiXactIdLimit(MultiXactId oldest_datminmxid, Oid oldest_datoid, bool is_startup)
MultiXactId GetOldestMultiXactId(void)
int MultiXactMemberFreezeThreshold(void)
MultiXactId ReadNextMultiXactId(void)
void TruncateMultiXact(MultiXactId newOldestMulti, Oid newOldestMultiDB)
#define MultiXactIdIsValid(multi)
Oid RangeVarGetRelidExtended(const RangeVar *relation, LOCKMODE lockmode, uint32 flags, RangeVarGetRelidCallback callback, void *callback_arg)
int parser_errposition(ParseState *pstate, int location)
#define ERRCODE_DATA_CORRUPTED
FormData_pg_class * Form_pg_class
TransactionId datfrozenxid
FormData_pg_database * Form_pg_database
List * find_all_inheritors(Oid parentrelId, LOCKMODE lockmode, List **numparents)
#define lfirst_node(type, lc)
static int list_length(const List *l)
static rewind_source * source
#define ERRCODE_UNDEFINED_TABLE
#define PostmasterIsAlive()
int pg_strcasecmp(const char *s1, const char *s2)
static Datum ObjectIdGetDatum(Oid X)
#define PROC_VACUUM_FOR_WRAPAROUND
TransactionId GetOldestNonRemovableTransactionId(Relation rel)
MemoryContextSwitchTo(old_ctx)
static long analyze(struct nfa *nfa)
#define RelationGetRelid(relation)
#define RelationGetRelationName(relation)
#define RELATION_IS_OTHER_TEMP(relation)
@ STDRD_OPTION_VACUUM_INDEX_CLEANUP_AUTO
@ STDRD_OPTION_VACUUM_INDEX_CLEANUP_OFF
@ STDRD_OPTION_VACUUM_INDEX_CLEANUP_ON
List * RelationGetIndexList(Relation relation)
void ScanKeyInit(ScanKey entry, AttrNumber attributeNumber, StrategyNumber strategy, RegProcedure procedure, Datum argument)
void pg_usleep(long microsec)
Snapshot GetTransactionSnapshot(void)
void PushActiveSnapshot(Snapshot snapshot)
bool ActiveSnapshotSet(void)
void PopActiveSnapshot(void)
void relation_close(Relation relation, LOCKMODE lockmode)
Relation try_relation_open(Oid relationId, LOCKMODE lockmode)
#define BTEqualStrategyNumber
BlockNumber pages_deleted
BlockNumber pages_newly_deleted
TransactionId FreezeLimit
TransactionId relfrozenxid
MultiXactId MultiXactCutoff
int multixact_freeze_min_age
int multixact_freeze_table_age
VacOptValue index_cleanup
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
void table_close(Relation relation, LOCKMODE lockmode)
Relation table_open(Oid relationId, LOCKMODE lockmode)
TableScanDesc table_beginscan_catalog(Relation relation, int nkeys, struct ScanKeyData *key)
static void table_endscan(TableScanDesc scan)
static void table_relation_vacuum(Relation rel, struct VacuumParams *params, BufferAccessStrategy bstrategy)
bool TidStoreIsMember(TidStore *ts, ItemPointer tid)
bool TransactionIdPrecedes(TransactionId id1, TransactionId id2)
bool TransactionIdPrecedesOrEquals(TransactionId id1, TransactionId id2)
static TransactionId ReadNextTransactionId(void)
#define FirstNormalTransactionId
#define TransactionIdIsValid(xid)
#define TransactionIdIsNormal(xid)
static bool vac_tid_reaped(ItemPointer itemptr, void *state)
void ExecVacuum(ParseState *pstate, VacuumStmt *vacstmt, bool isTopLevel)
IndexBulkDeleteResult * vac_bulkdel_one_index(IndexVacuumInfo *ivinfo, IndexBulkDeleteResult *istat, TidStore *dead_items, VacDeadItemsInfo *dead_items_info)
pg_atomic_uint32 * VacuumActiveNWorkers
static void vac_truncate_clog(TransactionId frozenXID, MultiXactId minMulti, TransactionId lastSaneFrozenXid, MultiXactId lastSaneMinMulti)
int vacuum_freeze_min_age
static List * expand_vacuum_rel(VacuumRelation *vrel, MemoryContext vac_context, int options)
static double compute_parallel_delay(void)
static VacOptValue get_vacoptval_from_boolean(DefElem *def)
void vac_open_indexes(Relation relation, LOCKMODE lockmode, int *nindexes, Relation **Irel)
void vacuum(List *relations, VacuumParams *params, BufferAccessStrategy bstrategy, MemoryContext vac_context, bool isTopLevel)
bool check_vacuum_buffer_usage_limit(int *newval, void **extra, GucSource source)
int VacuumCostBalanceLocal
static List * get_all_vacuum_rels(MemoryContext vac_context, int options)
void vac_update_relstats(Relation relation, BlockNumber num_pages, double num_tuples, BlockNumber num_all_visible_pages, bool hasindex, TransactionId frozenxid, MultiXactId minmulti, bool *frozenxid_updated, bool *minmulti_updated, bool in_outer_xact)
int vacuum_multixact_freeze_table_age
int vacuum_freeze_table_age
int vacuum_multixact_failsafe_age
int vacuum_multixact_freeze_min_age
Relation vacuum_open_relation(Oid relid, RangeVar *relation, bits32 options, bool verbose, LOCKMODE lmode)
static bool vacuum_rel(Oid relid, RangeVar *relation, VacuumParams *params, BufferAccessStrategy bstrategy)
void vac_close_indexes(int nindexes, Relation *Irel, LOCKMODE lockmode)
void vacuum_delay_point(void)
void vac_update_datfrozenxid(void)
bool vacuum_get_cutoffs(Relation rel, const VacuumParams *params, struct VacuumCutoffs *cutoffs)
bool vacuum_xid_failsafe_check(const struct VacuumCutoffs *cutoffs)
pg_atomic_uint32 * VacuumSharedCostBalance
bool VacuumFailsafeActive
double vac_estimate_reltuples(Relation relation, BlockNumber total_pages, BlockNumber scanned_pages, double scanned_tuples)
IndexBulkDeleteResult * vac_cleanup_one_index(IndexVacuumInfo *ivinfo, IndexBulkDeleteResult *istat)
bool vacuum_is_permitted_for_relation(Oid relid, Form_pg_class reltuple, bits32 options)
#define VACOPT_SKIP_LOCKED
#define VACOPT_SKIP_DATABASE_STATS
@ VACOPTVALUE_UNSPECIFIED
#define VACOPT_PROCESS_TOAST
#define VACOPT_DISABLE_PAGE_SKIPPING
#define VACOPT_ONLY_DATABASE_STATS
#define VACOPT_PROCESS_MAIN
void SetTransactionIdLimit(TransactionId oldest_datfrozenxid, Oid oldest_datoid)
bool ForceTransactionIdLimitUpdate(void)
static void pgstat_report_wait_start(uint32 wait_event_info)
static void pgstat_report_wait_end(void)
bool IsInTransactionBlock(bool isTopLevel)
void CommandCounterIncrement(void)
void PreventInTransactionBlock(bool isTopLevel, const char *stmtType)
void StartTransactionCommand(void)
void CommitTransactionCommand(void)