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")));
90 elog(
ERROR,
"non-SELECT statement in DECLARE CURSOR");
95 elog(
ERROR,
"non-SELECT statement in DECLARE CURSOR");
186 (
errcode(ERRCODE_INVALID_CURSOR_NAME),
187 errmsg(
"invalid cursor name: must not be empty")));
194 (
errcode(ERRCODE_UNDEFINED_CURSOR),
237 (
errcode(ERRCODE_INVALID_CURSOR_NAME),
238 errmsg(
"invalid cursor name: must not be empty")));
247 (
errcode(ERRCODE_UNDEFINED_CURSOR),
248 errmsg(
"cursor \"%s\" does not exist", name)));
335 Assert(queryDesc != NULL);
399 queryDesc->
dest = NULL;
430 elog(
ERROR,
"unexpected end of tuple stream");
void tuplestore_rescan(Tuplestorestate *state)
ParamListInfo copyParamList(ParamListInfo from)
Portal CreatePortal(const char *name, bool allowDup, bool dupSilent)
TupleDesc CreateTupleDescCopy(TupleDesc tupdesc)
List * QueryRewrite(Query *parsetree)
void PerformPortalClose(const char *name)
void PortalStart(Portal portal, ParamListInfo params, int eflags, Snapshot snapshot)
void(* cleanup)(Portal portal)
#define castNode(_type_, nodeptr)
void FreeQueryDesc(QueryDesc *qdesc)
Portal GetPortalByName(const char *name)
ResourceOwner CurrentResourceOwner
void SetTuplestoreDestReceiverParams(DestReceiver *self, Tuplestorestate *tStore, MemoryContext tContext, bool detoast, TupleDesc target_tupdesc, const char *map_failure_msg)
char * pstrdup(const char *in)
void MarkPortalActive(Portal portal)
uint64 PortalRunFetch(Portal portal, FetchDirection fdirection, long count, DestReceiver *dest)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Snapshot GetActiveSnapshot(void)
int errcode(int sqlerrcode)
MemoryContext holdContext
void PopActiveSnapshot(void)
void PortalCleanup(Portal portal)
void PortalDefineQuery(Portal portal, const char *prepStmtName, const char *sourceText, CommandTag commandTag, List *stmts, CachedPlan *cplan)
#define linitial_node(type, l)
DestReceiver * None_Receiver
MemoryContext portalContext
#define CURSOR_OPT_NO_SCROLL
MemoryContext PortalContext
void ExecutorEnd(QueryDesc *queryDesc)
void ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count, bool execute_once)
void PerformCursorOpen(ParseState *pstate, DeclareCursorStmt *cstmt, ParamListInfo params, bool isTopLevel)
void PerformPortalFetch(FetchStmt *stmt, DestReceiver *dest, QueryCompletion *qc)
void PushActiveSnapshot(Snapshot snap)
DestReceiver * CreateDestReceiver(CommandDest dest)
const char * p_sourcetext
SubTransactionId createSubid
#define AssertArg(condition)
void ExecutorFinish(QueryDesc *queryDesc)
void MemoryContextDeleteChildren(MemoryContext context)
void ExecutorRewind(QueryDesc *queryDesc)
bool ExecSupportsBackwardScan(Plan *node)
#define ereport(elevel,...)
void(* rDestroy)(DestReceiver *self)
void PortalHashTableDeleteAll(void)
#define Assert(condition)
bool InSecurityRestrictedOperation(void)
static void SetQueryCompletion(QueryCompletion *qc, CommandTag commandTag, uint64 nprocessed)
static int list_length(const List *l)
void PersistHoldablePortal(Portal portal)
void MarkPortalFailed(Portal portal)
bool tuplestore_skiptuples(Tuplestorestate *state, int64 ntuples, bool forward)
#define InvalidSubTransactionId
Tuplestorestate * holdStore
int errmsg(const char *fmt,...)
void PortalDrop(Portal portal, bool isTopCommit)
#define CURSOR_OPT_SCROLL
PlannedStmt * pg_plan_query(Query *querytree, const char *query_string, int cursorOptions, ParamListInfo boundParams)
void RequireTransactionBlock(bool isTopLevel, const char *stmtType)