59 if (table_name ==
NULL)
60 elog(
ERROR,
"cache lookup failed for relation %u", table_oid);
66 (
errcode(ERRCODE_UNDEFINED_CURSOR),
67 errmsg(
"cursor \"%s\" does not exist", cursor_name)));
75 (
errcode(ERRCODE_INVALID_CURSOR_STATE),
76 errmsg(
"cursor \"%s\" is not a SELECT query",
81 (
errcode(ERRCODE_INVALID_CURSOR_STATE),
82 errmsg(
"cursor \"%s\" is held from a previous transaction",
109 if (thiserm->
relid == table_oid)
113 (
errcode(ERRCODE_INVALID_CURSOR_STATE),
114 errmsg(
"cursor \"%s\" has multiple FOR UPDATE/SHARE references to table \"%s\"",
115 cursor_name, table_name)));
122 (
errcode(ERRCODE_INVALID_CURSOR_STATE),
123 errmsg(
"cursor \"%s\" does not have a FOR UPDATE/SHARE reference to table \"%s\"",
124 cursor_name, table_name)));
132 (
errcode(ERRCODE_INVALID_CURSOR_STATE),
133 errmsg(
"cursor \"%s\" is not positioned on a row",
165 (
errcode(ERRCODE_INVALID_CURSOR_STATE),
166 errmsg(
"cursor \"%s\" is not a simply updatable scan of table \"%s\"",
167 cursor_name, table_name)));
178 (
errcode(ERRCODE_INVALID_CURSOR_STATE),
179 errmsg(
"cursor \"%s\" is not positioned on a row",
198 Assert(tuple_tableoid == table_oid);
200 *current_tid = *tuple_tid;
217 paramId > 0 && paramId <= paramInfo->numParams)
223 (*paramInfo->
paramFetch) (paramInfo, paramId);
230 (
errcode(ERRCODE_DATATYPE_MISMATCH),
231 errmsg(
"type of parameter %d (%s) does not match that when preparing the plan (%s)",
242 (
errcode(ERRCODE_UNDEFINED_OBJECT),
243 errmsg(
"no value found for parameter %d", paramId)));
#define ItemPointerIsValid(pointer)
ParamExternData params[FLEXIBLE_ARRAY_MEMBER]
Portal GetPortalByName(const char *name)
#define DatumGetObjectId(X)
int errcode(int sqlerrcode)
TupleTableSlot * ss_ScanTupleSlot
Relation ss_currentRelation
#define OidIsValid(objectId)
#define RowMarkRequiresRowShareLock(marktype)
struct PlanState * lefttree
ItemPointerData * ItemPointer
ParamFetchHook paramFetch
#define TableOidAttributeNumber
#define ereport(elevel, rest)
static ScanState * search_plan_tree(PlanState *node, Oid table_oid)
#define TextDatumGetCString(d)
#define Assert(condition)
bool execCurrentOf(CurrentOfExpr *cexpr, ExprContext *econtext, Oid table_oid, ItemPointer current_tid)
#define DatumGetPointer(X)
#define PortalGetQueryDesc(portal)
int errmsg(const char *fmt,...)
static char * fetch_cursor_param_value(ExprContext *econtext, int paramId)
Datum slot_getattr(TupleTableSlot *slot, int attnum, bool *isnull)
#define SelfItemPointerAttributeNumber
#define PG_USED_FOR_ASSERTS_ONLY
ParamListInfo ecxt_param_list_info
char * get_rel_name(Oid relid)
#define RelationGetRelid(relation)