PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <math.h>
#include <limits.h>
#include "access/heapam.h"
#include "access/sysattr.h"
#include "catalog/namespace.h"
#include "catalog/pg_type.h"
#include "libpq/pqformat.h"
#include "miscadmin.h"
#include "parser/parsetree.h"
#include "utils/acl.h"
#include "utils/builtins.h"
#include "utils/rel.h"
#include "utils/snapmgr.h"
#include "utils/tqual.h"
#include "utils/varlena.h"
Go to the source code of this file.
Macros | |
#define | DatumGetItemPointer(X) ((ItemPointer) DatumGetPointer(X)) |
#define | ItemPointerGetDatum(X) PointerGetDatum(X) |
#define | PG_GETARG_ITEMPOINTER(n) DatumGetItemPointer(PG_GETARG_DATUM(n)) |
#define | PG_RETURN_ITEMPOINTER(x) return ItemPointerGetDatum(x) |
#define | LDELIM '(' |
#define | RDELIM ')' |
#define | DELIM ',' |
#define | NTIDARGS 2 |
Functions | |
Datum | tidin (PG_FUNCTION_ARGS) |
Datum | tidout (PG_FUNCTION_ARGS) |
Datum | tidrecv (PG_FUNCTION_ARGS) |
Datum | tidsend (PG_FUNCTION_ARGS) |
Datum | tideq (PG_FUNCTION_ARGS) |
Datum | tidne (PG_FUNCTION_ARGS) |
Datum | tidlt (PG_FUNCTION_ARGS) |
Datum | tidle (PG_FUNCTION_ARGS) |
Datum | tidgt (PG_FUNCTION_ARGS) |
Datum | tidge (PG_FUNCTION_ARGS) |
Datum | bttidcmp (PG_FUNCTION_ARGS) |
Datum | tidlarger (PG_FUNCTION_ARGS) |
Datum | tidsmaller (PG_FUNCTION_ARGS) |
void | setLastTid (const ItemPointer tid) |
static Datum | currtid_for_view (Relation viewrel, ItemPointer tid) |
Datum | currtid_byreloid (PG_FUNCTION_ARGS) |
Datum | currtid_byrelname (PG_FUNCTION_ARGS) |
Variables | |
static ItemPointerData | Current_last_tid = {{0, 0}, 0} |
#define DatumGetItemPointer | ( | X | ) | ((ItemPointer) DatumGetPointer(X)) |
#define ItemPointerGetDatum | ( | X | ) | PointerGetDatum(X) |
#define PG_GETARG_ITEMPOINTER | ( | n | ) | DatumGetItemPointer(PG_GETARG_DATUM(n)) |
Definition at line 40 of file tid.c.
Referenced by bttidcmp(), currtid_byrelname(), currtid_byreloid(), tideq(), tidge(), tidgt(), tidlarger(), tidle(), tidlt(), tidne(), tidout(), tidsend(), and tidsmaller().
#define PG_RETURN_ITEMPOINTER | ( | x | ) | return ItemPointerGetDatum(x) |
Definition at line 41 of file tid.c.
Referenced by currtid_byrelname(), currtid_byreloid(), tidin(), tidlarger(), tidrecv(), and tidsmaller().
Datum bttidcmp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 216 of file tid.c.
References ItemPointerCompare(), PG_GETARG_ITEMPOINTER, and PG_RETURN_INT32.
Datum currtid_byrelname | ( | PG_FUNCTION_ARGS | ) |
Definition at line 364 of file tid.c.
References AccessShareLock, ACL_SELECT, aclcheck_error(), ACLCHECK_OK, currtid_for_view(), get_relkind_objtype(), GetLatestSnapshot(), GetUserId(), heap_close, heap_get_latest_tid(), heap_openrv(), ItemPointerCopy, makeRangeVarFromNameList(), palloc(), pg_class_aclcheck(), PG_GETARG_ITEMPOINTER, PG_GETARG_TEXT_PP, PG_RETURN_ITEMPOINTER, RelationData::rd_rel, RegisterSnapshot(), RelationGetRelationName, RelationGetRelid, textToQualifiedNameList(), and UnregisterSnapshot().
Datum currtid_byreloid | ( | PG_FUNCTION_ARGS | ) |
Definition at line 325 of file tid.c.
References AccessShareLock, ACL_SELECT, aclcheck_error(), ACLCHECK_OK, Current_last_tid, currtid_for_view(), get_relkind_objtype(), GetLatestSnapshot(), GetUserId(), heap_close, heap_get_latest_tid(), heap_open(), ItemPointerCopy, palloc(), pg_class_aclcheck(), PG_GETARG_ITEMPOINTER, PG_GETARG_OID, PG_RETURN_ITEMPOINTER, RelationData::rd_rel, RegisterSnapshot(), RelationGetRelationName, RelationGetRelid, and UnregisterSnapshot().
Referenced by currtid_for_view().
|
static |
Definition at line 263 of file tid.c.
References AccessShareLock, RewriteRule::actions, CMD_SELECT, currtid_byreloid(), DirectFunctionCall2, elog, ERROR, RewriteRule::event, TargetEntry::expr, get_tle_by_resno(), heap_close, i, IS_SPECIAL_VARNO, IsA, linitial, list_length(), NameStr, tupleDesc::natts, RuleLock::numLocks, ObjectIdGetDatum, PointerGetDatum, RelationData::rd_rules, RelationGetDescr, rt_fetch, Query::rtable, RuleLock::rules, SelfItemPointerAttributeNumber, Query::targetList, TupleDescAttr, Var::varattno, and Var::varno.
Referenced by currtid_byrelname(), and currtid_byreloid().
void setLastTid | ( | const ItemPointer | tid | ) |
Datum tideq | ( | PG_FUNCTION_ARGS | ) |
Definition at line 162 of file tid.c.
References ItemPointerCompare(), PG_GETARG_ITEMPOINTER, and PG_RETURN_BOOL.
Datum tidge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 207 of file tid.c.
References ItemPointerCompare(), PG_GETARG_ITEMPOINTER, and PG_RETURN_BOOL.
Datum tidgt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 198 of file tid.c.
References ItemPointerCompare(), PG_GETARG_ITEMPOINTER, and PG_RETURN_BOOL.
Datum tidin | ( | PG_FUNCTION_ARGS | ) |
Definition at line 53 of file tid.c.
References DELIM, ereport, errcode(), errmsg(), ERROR, i, ItemPointerSet, LDELIM, NTIDARGS, palloc(), PG_GETARG_CSTRING, PG_RETURN_ITEMPOINTER, RDELIM, and generate_unaccent_rules::str.
Referenced by make_tuple_from_result_row().
Datum tidlarger | ( | PG_FUNCTION_ARGS | ) |
Definition at line 225 of file tid.c.
References ItemPointerCompare(), PG_GETARG_ITEMPOINTER, and PG_RETURN_ITEMPOINTER.
Datum tidle | ( | PG_FUNCTION_ARGS | ) |
Definition at line 189 of file tid.c.
References ItemPointerCompare(), PG_GETARG_ITEMPOINTER, and PG_RETURN_BOOL.
Datum tidlt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 180 of file tid.c.
References ItemPointerCompare(), PG_GETARG_ITEMPOINTER, and PG_RETURN_BOOL.
Datum tidne | ( | PG_FUNCTION_ARGS | ) |
Definition at line 171 of file tid.c.
References ItemPointerCompare(), PG_GETARG_ITEMPOINTER, and PG_RETURN_BOOL.
Datum tidout | ( | PG_FUNCTION_ARGS | ) |
Definition at line 105 of file tid.c.
References buf, ItemPointerGetBlockNumberNoCheck, ItemPointerGetOffsetNumberNoCheck, PG_GETARG_ITEMPOINTER, PG_RETURN_CSTRING, pstrdup(), and snprintf().
Referenced by pgrowlocks().
Datum tidrecv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 125 of file tid.c.
References buf, ItemPointerSet, palloc(), PG_GETARG_POINTER, PG_RETURN_ITEMPOINTER, and pq_getmsgint().
Datum tidsend | ( | PG_FUNCTION_ARGS | ) |
Definition at line 146 of file tid.c.
References buf, ItemPointerGetBlockNumberNoCheck, ItemPointerGetOffsetNumberNoCheck, PG_GETARG_ITEMPOINTER, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), pq_sendint16(), and pq_sendint32().
Datum tidsmaller | ( | PG_FUNCTION_ARGS | ) |
Definition at line 234 of file tid.c.
References ItemPointerCompare(), PG_GETARG_ITEMPOINTER, and PG_RETURN_ITEMPOINTER.
|
static |
Definition at line 249 of file tid.c.
Referenced by currtid_byreloid().