33 #include "catalog/pg_am_d.h"
59 #define Atnum_ismulti 2
84 if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
86 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
87 errmsg(
"\"%s\" is a partitioned table",
89 errdetail(
"Partitioned tables do not contain rows.")));
90 else if (rel->rd_rel->relkind != RELKIND_RELATION)
92 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
93 errmsg(
"\"%s\" is not a table",
95 else if (rel->rd_rel->relam != HEAP_TABLE_AM_OID)
97 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
98 errmsg(
"only heap AM is supported")));
134 infomask = tuple->t_data->t_infomask;
176 for (
j = 0;
j < nmembers;
j++)
188 switch (members[
j].status)
246 "{transient upgrade status}");
bool has_privs_of_role(Oid member, Oid role)
void aclcheck_error(AclResult aclerr, ObjectType objtype, const char *objectname)
AclResult pg_class_aclcheck(Oid table_oid, Oid roleid, AclMode mode)
static Datum values[MAXATTR]
void LockBuffer(Buffer buffer, int mode)
#define BUFFER_LOCK_UNLOCK
#define BUFFER_LOCK_SHARE
int errdetail(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
HeapTuple BuildTupleFromCStrings(AttInMetadata *attinmeta, char **values)
AttInMetadata * TupleDescGetAttInMetadata(TupleDesc tupdesc)
#define PG_GETARG_TEXT_PP(n)
#define DirectFunctionCall1(func, arg1)
void InitMaterializedSRF(FunctionCallInfo fcinfo, bits32 flags)
HeapTuple heap_getnext(TableScanDesc sscan, ScanDirection direction)
struct HeapScanDescData * HeapScanDesc
TM_Result HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid, Buffer buffer)
#define HEAP_XMAX_IS_EXCL_LOCKED(infomask)
#define HEAP_XMAX_IS_KEYSHR_LOCKED(infomask)
#define HEAP_KEYS_UPDATED
#define HEAP_XMAX_LOCK_ONLY
#define HEAP_XMAX_IS_MULTI
#define HeapTupleHeaderGetRawXmax(tup)
#define HEAP_XMAX_IS_SHR_LOCKED(infomask)
#define HEAP_LOCKED_UPGRADED(infomask)
char * pstrdup(const char *in)
int GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **members, bool from_pgupgrade, bool isLockOnly)
@ MultiXactStatusForShare
@ MultiXactStatusForNoKeyUpdate
@ MultiXactStatusNoKeyUpdate
@ MultiXactStatusForUpdate
@ MultiXactStatusForKeyShare
RangeVar * makeRangeVarFromNameList(const List *names)
ObjectType get_relkind_objtype(char relkind)
Datum pgrowlocks(PG_FUNCTION_ARGS)
PG_FUNCTION_INFO_V1(pgrowlocks)
static Datum PointerGetDatum(const void *X)
int BackendXidGetPid(TransactionId xid)
#define RelationGetRelid(relation)
#define RelationGetRelationName(relation)
Snapshot GetActiveSnapshot(void)
Relation relation_openrv(const RangeVar *relation, LOCKMODE lockmode)
Tuplestorestate * setResult
void table_close(Relation relation, LOCKMODE lockmode)
static TableScanDesc table_beginscan(Relation rel, Snapshot snapshot, int nkeys, struct ScanKeyData *key)
static void table_endscan(TableScanDesc scan)
Datum tidout(PG_FUNCTION_ARGS)
void tuplestore_puttuple(Tuplestorestate *state, HeapTuple tuple)
List * textToQualifiedNameList(text *textval)
CommandId GetCurrentCommandId(bool used)