Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd27f363

Browse files
Jan WieckJan Wieck
Jan Wieck
authored and
Jan Wieck
committed
Enhancement of SPI to get access to portals
- New functions to create a portal using a prepared/saved SPI plan or lookup an existing portal by name.- Functions to fetch/move from/in portals. Results are placed in the usual SPI_processed and SPI_tuptable, so the entire set of utility functions can be used to gain attribute access.- Prepared/saved SPI plans now use their own memory context and SPI_freeplan(plan) can remove them.- Tuple result sets (SPI_tuptable) now uses it's own memory context and can be free'd by SPI_freetuptable(tuptab).Enhancement of PL/pgSQL- Uses generic named portals internally in FOR ... SELECT loops to avoid running out of memory on huge result sets.- Support for CURSOR and REFCURSOR syntax using the new SPI functionality. Cursors used internally only need no explicit transaction block. Refcursor variables can be used inside of explicit transaction block to pass cursors between main application and functions.Jan
1 parentbe03eb2 commitd27f363

File tree

13 files changed

+1514
-114
lines changed

13 files changed

+1514
-114
lines changed

‎src/backend/commands/command.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.127 2001/05/09 21:10:38 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.128 2001/05/21 14:22:11 wieck Exp $
1212
*
1313
* NOTES
1414
* The PerformAddAttribute() code, like most of the relation
@@ -108,6 +108,7 @@ PerformPortalFetch(char *name,
108108
QueryDesc*queryDesc;
109109
EState*estate;
110110
MemoryContextoldcontext;
111+
boolfaked_desc= false;
111112

112113
/*
113114
* sanity checks
@@ -143,13 +144,14 @@ PerformPortalFetch(char *name,
143144
queryDesc=PortalGetQueryDesc(portal);
144145
estate=PortalGetState(portal);
145146

146-
if (dest==None)/* MOVE */
147+
if (dest!=queryDesc->dest)/* MOVE */
147148
{
148149
QueryDesc*qdesc= (QueryDesc*)palloc(sizeof(QueryDesc));
149150

150151
memcpy(qdesc,queryDesc,sizeof(QueryDesc));
151152
qdesc->dest=dest;
152153
queryDesc=qdesc;
154+
faked_desc= true;
153155
}
154156

155157
BeginCommand(name,
@@ -197,7 +199,7 @@ PerformPortalFetch(char *name,
197199
/*
198200
* Clean up and switch back to old context.
199201
*/
200-
if (dest==None)/* MOVE */
202+
if (faked_desc)/* MOVE */
201203
pfree(queryDesc);
202204

203205
MemoryContextSwitchTo(oldcontext);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp