28 bool *pending_rescan);
62 if (table_name == NULL)
63 elog(
ERROR,
"cache lookup failed for relation %u", table_oid);
69 (
errcode(ERRCODE_UNDEFINED_CURSOR),
70 errmsg(
"cursor \"%s\" does not exist", cursor_name)));
78 (
errcode(ERRCODE_INVALID_CURSOR_STATE),
79 errmsg(
"cursor \"%s\" is not a SELECT query",
82 if (queryDesc == NULL || queryDesc->
estate == NULL)
84 (
errcode(ERRCODE_INVALID_CURSOR_STATE),
85 errmsg(
"cursor \"%s\" is held from a previous transaction",
109 if (thiserm == NULL ||
113 if (thiserm->
relid == table_oid)
117 (
errcode(ERRCODE_INVALID_CURSOR_STATE),
118 errmsg(
"cursor \"%s\" has multiple FOR UPDATE/SHARE references to table \"%s\"",
119 cursor_name, table_name)));
126 (
errcode(ERRCODE_INVALID_CURSOR_STATE),
127 errmsg(
"cursor \"%s\" does not have a FOR UPDATE/SHARE reference to table \"%s\"",
128 cursor_name, table_name)));
136 (
errcode(ERRCODE_INVALID_CURSOR_STATE),
137 errmsg(
"cursor \"%s\" is not positioned on a row",
162 bool pending_rescan =
false;
168 (
errcode(ERRCODE_INVALID_CURSOR_STATE),
169 errmsg(
"cursor \"%s\" is not a simply updatable scan of table \"%s\"",
170 cursor_name, table_name)));
181 (
errcode(ERRCODE_INVALID_CURSOR_STATE),
182 errmsg(
"cursor \"%s\" is not positioned on a row",
221#ifdef USE_ASSERT_CHECKING
227 (
errcode(ERRCODE_INVALID_CURSOR_STATE),
228 errmsg(
"cursor \"%s\" is not a simply updatable scan of table \"%s\"",
229 cursor_name, table_name)));
238 (
errcode(ERRCODE_INVALID_CURSOR_STATE),
239 errmsg(
"cursor \"%s\" is not a simply updatable scan of table \"%s\"",
240 cursor_name, table_name)));
243 *current_tid = *tuple_tid;
263 paramId > 0 && paramId <= paramInfo->numParams)
270 prm = paramInfo->
paramFetch(paramInfo, paramId,
false, &prmdata);
272 prm = ¶mInfo->
params[paramId - 1];
277 if (prm->
ptype != REFCURSOROID)
279 (
errcode(ERRCODE_DATATYPE_MISMATCH),
280 errmsg(
"type of parameter %d (%s) does not match that when preparing the plan (%s)",
291 (
errcode(ERRCODE_UNDEFINED_OBJECT),
292 errmsg(
"no value found for parameter %d", paramId)));
315 bool *pending_rescan)
334 case T_SampleScanState:
335 case T_IndexScanState:
336 case T_IndexOnlyScanState:
337 case T_BitmapHeapScanState:
339 case T_TidRangeScanState:
340 case T_ForeignScanState:
341 case T_CustomScanState:
407 case T_SubqueryScanState:
422 if (result && node->
chgParam != NULL)
423 *pending_rescan =
true;
#define TextDatumGetCString(d)
#define OidIsValid(objectId)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
static ScanState * search_plan_tree(PlanState *node, Oid table_oid, bool *pending_rescan)
static char * fetch_cursor_param_value(ExprContext *econtext, int paramId)
bool execCurrentOf(CurrentOfExpr *cexpr, ExprContext *econtext, Oid table_oid, ItemPointer current_tid)
#define outerPlanState(node)
Assert(PointerIsAligned(start, uint64))
ItemPointerData * ItemPointer
static bool ItemPointerIsValid(const ItemPointerData *pointer)
char * get_rel_name(Oid relid)
#define IsA(nodeptr, _type_)
#define RowMarkRequiresRowShareLock(marktype)
Portal GetPortalByName(const char *name)
static Oid DatumGetObjectId(Datum X)
static Pointer DatumGetPointer(Datum X)
#define RelationGetRelid(relation)
struct ExecRowMark ** es_rowmarks
Index es_range_table_size
ParamListInfo ecxt_param_list_info
ItemPointerData xs_heaptid
ParamExternData params[FLEXIBLE_ARRAY_MEMBER]
ParamFetchHook paramFetch
Relation ss_currentRelation
TupleTableSlot * ss_ScanTupleSlot
#define TableOidAttributeNumber
#define SelfItemPointerAttributeNumber
static Datum slot_getsysattr(TupleTableSlot *slot, int attnum, bool *isnull)