40 #define DatumGetItemPointer(X) ((ItemPointer) DatumGetPointer(X))
41 #define ItemPointerGetDatum(X) PointerGetDatum(X)
42 #define PG_GETARG_ITEMPOINTER(n) DatumGetItemPointer(PG_GETARG_DATUM(n))
43 #define PG_RETURN_ITEMPOINTER(x) return ItemPointerGetDatum(x)
75 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
76 errmsg(
"invalid input syntax for type %s: \"%s\"",
80 cvt = strtoul(coord[0], &badp, 10);
81 if (errno || *badp !=
DELIM)
83 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
84 errmsg(
"invalid input syntax for type %s: \"%s\"",
94 if (cvt != (
unsigned long) blockNumber &&
95 cvt != (
unsigned long) ((
int32) blockNumber))
97 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
98 errmsg(
"invalid input syntax for type %s: \"%s\"",
102 cvt = strtoul(coord[1], &badp, 10);
103 if (errno || *badp !=
RDELIM ||
106 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
107 errmsg(
"invalid input syntax for type %s: \"%s\"",
315 if (rel->
rd_rel->relkind == RELKIND_VIEW)
318 if (!RELKIND_HAS_STORAGE(rel->
rd_rel->relkind))
319 elog(
ERROR,
"cannot look at latest visible tid for relation \"%s.%s\"",
349 for (
i = 0;
i < natts;
i++)
353 if (strcmp(
NameStr(attr->attname),
"ctid") == 0)
355 if (attr->atttypid != TIDOID)
362 elog(
ERROR,
"currtid cannot handle views with no CTID");
368 rewrite = rulelock->
rules[
i];
375 elog(
ERROR,
"only one select rule is allowed in views");
402 elog(
ERROR,
"currtid cannot handle this view");
void aclcheck_error(AclResult aclerr, ObjectType objtype, const char *objectname)
AclResult pg_class_aclcheck(Oid table_oid, Oid roleid, AclMode mode)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define PG_GETARG_TEXT_PP(n)
#define PG_RETURN_BYTEA_P(x)
#define PG_GETARG_POINTER(n)
#define PG_RETURN_CSTRING(x)
#define PG_GETARG_CSTRING(n)
#define PG_GETARG_INT64(n)
#define PG_RETURN_INT32(x)
#define PG_RETURN_BOOL(x)
static Datum hash_any_extended(const unsigned char *k, int keylen, uint64 seed)
static Datum hash_any(const unsigned char *k, int keylen)
int32 ItemPointerCompare(ItemPointer arg1, ItemPointer arg2)
#define ItemPointerGetBlockNumberNoCheck(pointer)
#define ItemPointerCopy(fromPointer, toPointer)
#define ItemPointerSet(pointer, blockNumber, offNum)
ItemPointerData * ItemPointer
#define ItemPointerGetOffsetNumberNoCheck(pointer)
char * get_namespace_name(Oid nspid)
char * pstrdup(const char *in)
RangeVar * makeRangeVarFromNameList(List *names)
#define IsA(nodeptr, _type_)
ObjectType get_relkind_objtype(char relkind)
TargetEntry * get_tle_by_resno(List *tlist, AttrNumber resno)
#define rt_fetch(rangetable_index, rangetable)
FormData_pg_attribute * Form_pg_attribute
static int list_length(const List *l)
#define IS_SPECIAL_VARNO(varno)
#define RelationGetRelid(relation)
#define RelationGetDescr(relation)
#define RelationGetRelationName(relation)
#define RelationGetNamespace(relation)
Snapshot GetLatestSnapshot(void)
void UnregisterSnapshot(Snapshot snapshot)
Snapshot RegisterSnapshot(Snapshot snapshot)
StringInfoData * StringInfo
#define SelfItemPointerAttributeNumber
void table_close(Relation relation, LOCKMODE lockmode)
Relation table_open(Oid relationId, LOCKMODE lockmode)
Relation table_openrv(const RangeVar *relation, LOCKMODE lockmode)
void table_tuple_get_latest_tid(TableScanDesc scan, ItemPointer tid)
static void table_endscan(TableScanDesc scan)
static TableScanDesc table_beginscan_tid(Relation rel, Snapshot snapshot)
Datum tidge(PG_FUNCTION_ARGS)
Datum bttidcmp(PG_FUNCTION_ARGS)
Datum currtid_byrelname(PG_FUNCTION_ARGS)
static ItemPointer currtid_internal(Relation rel, ItemPointer tid)
Datum hashtid(PG_FUNCTION_ARGS)
Datum tidlarger(PG_FUNCTION_ARGS)
#define PG_RETURN_ITEMPOINTER(x)
Datum hashtidextended(PG_FUNCTION_ARGS)
Datum tideq(PG_FUNCTION_ARGS)
Datum tidgt(PG_FUNCTION_ARGS)
Datum tidin(PG_FUNCTION_ARGS)
Datum tidle(PG_FUNCTION_ARGS)
#define PG_GETARG_ITEMPOINTER(n)
Datum tidsmaller(PG_FUNCTION_ARGS)
Datum tidne(PG_FUNCTION_ARGS)
static ItemPointer currtid_for_view(Relation viewrel, ItemPointer tid)
Datum tidrecv(PG_FUNCTION_ARGS)
Datum tidout(PG_FUNCTION_ARGS)
Datum tidsend(PG_FUNCTION_ARGS)
Datum tidlt(PG_FUNCTION_ARGS)
#define TupleDescAttr(tupdesc, i)
List * textToQualifiedNameList(text *textval)