PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/clog.h"
#include "access/transam.h"
#include "access/xact.h"
#include "access/xlog.h"
#include "funcapi.h"
#include "lib/qunique.h"
#include "libpq/pqformat.h"
#include "miscadmin.h"
#include "postmaster/postmaster.h"
#include "storage/lwlock.h"
#include "utils/builtins.h"
#include "utils/memutils.h"
#include "utils/snapmgr.h"
#include "utils/xid8.h"
Go to the source code of this file.
Data Structures | |
struct | pg_snapshot |
Macros | |
#define | USE_BSEARCH_IF_NXIP_GREATER 30 |
#define | PG_SNAPSHOT_SIZE(nxip) (offsetof(pg_snapshot, xip) + sizeof(FullTransactionId) * (nxip)) |
#define | PG_SNAPSHOT_MAX_NXIP ((MaxAllocSize - offsetof(pg_snapshot, xip)) / sizeof(FullTransactionId)) |
#define PG_SNAPSHOT_MAX_NXIP ((MaxAllocSize - offsetof(pg_snapshot, xip)) / sizeof(FullTransactionId)) |
Definition at line 73 of file xid8funcs.c.
Referenced by pg_current_snapshot(), and pg_snapshot_recv().
#define PG_SNAPSHOT_SIZE | ( | nxip | ) | (offsetof(pg_snapshot, xip) + sizeof(FullTransactionId) * (nxip)) |
Definition at line 71 of file xid8funcs.c.
Referenced by buf_init(), pg_current_snapshot(), and pg_snapshot_recv().
#define USE_BSEARCH_IF_NXIP_GREATER 30 |
Definition at line 49 of file xid8funcs.c.
Referenced by is_visible_fxid().
|
static |
Definition at line 260 of file xid8funcs.c.
References appendBinaryStringInfo(), StringInfoData::data, and pg_snapshot::nxip.
Referenced by parse_snapshot().
|
static |
Definition at line 271 of file xid8funcs.c.
References StringInfoData::data, StringInfoData::len, pfree(), and SET_VARSIZE.
Referenced by parse_snapshot().
|
static |
Definition at line 245 of file xid8funcs.c.
References appendBinaryStringInfo(), buf, makeStringInfo(), pg_snapshot::nxip, PG_SNAPSHOT_SIZE, pg_snapshot::xmax, and pg_snapshot::xmin.
Referenced by parse_snapshot().
|
static |
Definition at line 176 of file xid8funcs.c.
References FullTransactionIdPrecedes.
Referenced by is_visible_fxid(), and sort_snapshot().
|
static |
Definition at line 210 of file xid8funcs.c.
References cmp_fxid(), false, FullTransactionIdEquals, FullTransactionIdPrecedes, i, pg_snapshot::nxip, USE_BSEARCH_IF_NXIP_GREATER, pg_snapshot::xip, pg_snapshot::xmax, and pg_snapshot::xmin.
Referenced by pg_visible_in_snapshot().
|
static |
Definition at line 288 of file xid8funcs.c.
References buf, buf_add_txid(), buf_finalize(), buf_init(), ereport, errcode(), errmsg(), ERROR, FullTransactionIdEquals, FullTransactionIdFollowsOrEquals, FullTransactionIdFromU64(), FullTransactionIdIsValid, FullTransactionIdPrecedes, InvalidFullTransactionId, pg_strtouint64(), generate_unaccent_rules::str, and val.
Referenced by pg_snapshot_in().
Datum pg_current_snapshot | ( | PG_FUNCTION_ARGS | ) |
Definition at line 394 of file xid8funcs.c.
References cur, elog, ERROR, GetActiveSnapshot(), i, MAX_BACKENDS, pg_snapshot::nxip, palloc(), PG_RETURN_POINTER, PG_SNAPSHOT_MAX_NXIP, PG_SNAPSHOT_SIZE, ReadNextFullTransactionId(), SET_VARSIZE, sort_snapshot(), StaticAssertStmt, widen_snapshot_xid(), SnapshotData::xcnt, pg_snapshot::xip, SnapshotData::xip, pg_snapshot::xmax, SnapshotData::xmax, pg_snapshot::xmin, and SnapshotData::xmin.
Datum pg_current_xact_id | ( | PG_FUNCTION_ARGS | ) |
Definition at line 358 of file xid8funcs.c.
References GetTopFullTransactionId(), PG_RETURN_FULLTRANSACTIONID, and PreventCommandDuringRecovery().
Datum pg_current_xact_id_if_assigned | ( | PG_FUNCTION_ARGS | ) |
Definition at line 376 of file xid8funcs.c.
References FullTransactionIdIsValid, GetTopFullTransactionIdIfAny(), PG_RETURN_FULLTRANSACTIONID, and PG_RETURN_NULL.
Datum pg_snapshot_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 445 of file xid8funcs.c.
References parse_snapshot(), PG_GETARG_CSTRING, PG_RETURN_POINTER, and generate_unaccent_rules::str.
Datum pg_snapshot_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 461 of file xid8funcs.c.
References appendStringInfo(), appendStringInfoChar(), StringInfoData::data, i, initStringInfo(), pg_snapshot::nxip, PG_GETARG_VARLENA_P, PG_RETURN_CSTRING, generate_unaccent_rules::str, U64FromFullTransactionId, UINT64_FORMAT, pg_snapshot::xip, pg_snapshot::xmax, and pg_snapshot::xmin.
Datum pg_snapshot_recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 493 of file xid8funcs.c.
References buf, cur, ereport, errcode(), errmsg(), ERROR, FullTransactionIdEquals, FullTransactionIdFromU64(), FullTransactionIdIsValid, FullTransactionIdPrecedes, i, InvalidFullTransactionId, pg_snapshot::nxip, palloc(), PG_GETARG_POINTER, PG_RETURN_POINTER, PG_SNAPSHOT_MAX_NXIP, PG_SNAPSHOT_SIZE, pq_getmsgint(), pq_getmsgint64(), SET_VARSIZE, pg_snapshot::xip, pg_snapshot::xmax, and pg_snapshot::xmin.
Datum pg_snapshot_send | ( | PG_FUNCTION_ARGS | ) |
Definition at line 559 of file xid8funcs.c.
References buf, i, pg_snapshot::nxip, PG_GETARG_VARLENA_P, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), pq_sendint32(), pq_sendint64(), U64FromFullTransactionId, pg_snapshot::xip, pg_snapshot::xmax, and pg_snapshot::xmin.
Datum pg_snapshot_xip | ( | PG_FUNCTION_ARGS | ) |
Definition at line 620 of file xid8funcs.c.
References arg, FuncCallContext::call_cntr, FullTransactionIdGetDatum, MemoryContextAlloc(), FuncCallContext::multi_call_memory_ctx, pg_snapshot::nxip, PG_GETARG_VARLENA_P, SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, FuncCallContext::user_fctx, value, VARSIZE, and pg_snapshot::xip.
Datum pg_snapshot_xmax | ( | PG_FUNCTION_ARGS | ) |
Definition at line 607 of file xid8funcs.c.
References PG_GETARG_VARLENA_P, PG_RETURN_FULLTRANSACTIONID, and pg_snapshot::xmax.
Datum pg_snapshot_xmin | ( | PG_FUNCTION_ARGS | ) |
Definition at line 594 of file xid8funcs.c.
References PG_GETARG_VARLENA_P, PG_RETURN_FULLTRANSACTIONID, and pg_snapshot::xmin.
Datum pg_visible_in_snapshot | ( | PG_FUNCTION_ARGS | ) |
Definition at line 580 of file xid8funcs.c.
References is_visible_fxid(), PG_GETARG_FULLTRANSACTIONID, PG_GETARG_VARLENA_P, PG_RETURN_BOOL, and value.
Datum pg_xact_status | ( | PG_FUNCTION_ARGS | ) |
Definition at line 665 of file xid8funcs.c.
References Assert, cstring_to_text(), GetActiveSnapshot(), LW_SHARED, LWLockAcquire(), LWLockRelease(), PG_GETARG_FULLTRANSACTIONID, PG_RETURN_NULL, PG_RETURN_TEXT_P, status(), TransactionIdDidAbort(), TransactionIdDidCommit(), TransactionIdInRecentPast(), TransactionIdIsCurrentTransactionId(), TransactionIdIsValid, and TransactionIdPrecedes().
|
static |
Definition at line 196 of file xid8funcs.c.
References cmp_fxid(), pg_snapshot::nxip, qsort, qunique(), and pg_snapshot::xip.
Referenced by pg_current_snapshot().
|
static |
Definition at line 90 of file xid8funcs.c.
References Assert, EpochFromFullTransactionId, ereport, errcode(), errmsg(), ERROR, FullTransactionIdPrecedes, LWLockHeldByMe(), VariableCacheData::oldestClogXid, psprintf(), ReadNextFullTransactionId(), ShmemVariableCache, TransactionIdIsNormal, TransactionIdIsValid, TransactionIdPrecedes(), U64FromFullTransactionId, UINT64_FORMAT, and XidFromFullTransactionId.
Referenced by pg_xact_status().
|
static |
Definition at line 150 of file xid8funcs.c.
References epoch, EpochFromFullTransactionId, FullTransactionIdFromEpochAndXid(), TransactionIdIsNormal, and XidFromFullTransactionId.
Referenced by pg_current_snapshot().