59 (
errcode(ERRCODE_INVALID_CURSOR_NAME),
60 errmsg(
"invalid cursor name: must not be empty")));
71 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
72 errmsg(
"cannot create a cursor WITH HOLD within security-restricted operation")));
84 elog(
ERROR,
"non-SELECT statement in DECLARE CURSOR");
89 elog(
ERROR,
"non-SELECT statement in DECLARE CURSOR");
178 if (!
stmt->portalname ||
stmt->portalname[0] ==
'\0')
180 (
errcode(ERRCODE_INVALID_CURSOR_NAME),
181 errmsg(
"invalid cursor name: must not be empty")));
188 (
errcode(ERRCODE_UNDEFINED_CURSOR),
189 errmsg(
"cursor \"%s\" does not exist",
stmt->portalname)));
231 (
errcode(ERRCODE_INVALID_CURSOR_NAME),
232 errmsg(
"invalid cursor name: must not be empty")));
241 (
errcode(ERRCODE_UNDEFINED_CURSOR),
242 errmsg(
"cursor \"%s\" does not exist",
name)));
329 Assert(queryDesc != NULL);
423 queryDesc->
dest = NULL;
460 elog(
ERROR,
"unexpected end of tuple stream");
#define InvalidSubTransactionId
#define Assert(condition)
static void SetQueryCompletion(QueryCompletion *qc, CommandTag commandTag, uint64 nprocessed)
DestReceiver * None_Receiver
DestReceiver * CreateDestReceiver(CommandDest dest)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
bool ExecSupportsBackwardScan(Plan *node)
void ExecutorEnd(QueryDesc *queryDesc)
void ExecutorFinish(QueryDesc *queryDesc)
void ExecutorRewind(QueryDesc *queryDesc)
void ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count, bool execute_once)
char * pstrdup(const char *in)
void MemoryContextDeleteChildren(MemoryContext context)
MemoryContext PortalContext
bool InSecurityRestrictedOperation(void)
#define castNode(_type_, nodeptr)
ParamListInfo copyParamList(ParamListInfo from)
#define CURSOR_OPT_SCROLL
#define CURSOR_OPT_NO_SCROLL
static int list_length(const List *l)
#define linitial_node(type, l)
void PerformCursorOpen(ParseState *pstate, DeclareCursorStmt *cstmt, ParamListInfo params, bool isTopLevel)
void PerformPortalClose(const char *name)
void PortalCleanup(Portal portal)
void PerformPortalFetch(FetchStmt *stmt, DestReceiver *dest, QueryCompletion *qc)
void PersistHoldablePortal(Portal portal)
void MarkPortalFailed(Portal portal)
void MarkPortalActive(Portal portal)
void PortalDrop(Portal portal, bool isTopCommit)
Portal GetPortalByName(const char *name)
void PortalDefineQuery(Portal portal, const char *prepStmtName, const char *sourceText, CommandTag commandTag, List *stmts, CachedPlan *cplan)
void PortalHashTableDeleteAll(void)
Portal CreatePortal(const char *name, bool allowDup, bool dupSilent)
PlannedStmt * pg_plan_query(Query *querytree, const char *query_string, int cursorOptions, ParamListInfo boundParams)
void FreeQueryDesc(QueryDesc *qdesc)
void PortalStart(Portal portal, ParamListInfo params, int eflags, Snapshot snapshot)
uint64 PortalRunFetch(Portal portal, FetchDirection fdirection, long count, DestReceiver *dest)
MemoryContextSwitchTo(old_ctx)
ResourceOwner CurrentResourceOwner
List * QueryRewrite(Query *parsetree)
@ NoMovementScanDirection
void PushActiveSnapshot(Snapshot snapshot)
void PopActiveSnapshot(void)
Snapshot GetActiveSnapshot(void)
const char * p_sourcetext
SubTransactionId createSubid
MemoryContext holdContext
MemoryContext portalContext
Tuplestorestate * holdStore
void(* cleanup)(Portal portal)
void(* rDestroy)(DestReceiver *self)
void SetTuplestoreDestReceiverParams(DestReceiver *self, Tuplestorestate *tStore, MemoryContext tContext, bool detoast, TupleDesc target_tupdesc, const char *map_failure_msg)
TupleDesc CreateTupleDescCopy(TupleDesc tupdesc)
void tuplestore_rescan(Tuplestorestate *state)
bool tuplestore_skiptuples(Tuplestorestate *state, int64 ntuples, bool forward)
void RequireTransactionBlock(bool isTopLevel, const char *stmtType)