|
14 | 14 | *
|
15 | 15 | *
|
16 | 16 | * IDENTIFICATION
|
17 |
| - * $Header: /cvsroot/pgsql/src/backend/commands/portalcmds.c,v 1.23 2003/08/08 21:41:32 momjian Exp $ |
| 17 | + * $Header: /cvsroot/pgsql/src/backend/commands/portalcmds.c,v 1.24 2003/08/24 21:02:43 petere Exp $ |
18 | 18 | *
|
19 | 19 | *-------------------------------------------------------------------------
|
20 | 20 | */
|
@@ -88,10 +88,9 @@ PerformCursorOpen(DeclareCursorStmt *stmt)
|
88 | 88 |
|
89 | 89 | /*
|
90 | 90 | * Create a portal and copy the query and plan into its memory
|
91 |
| - * context. (If a duplicate cursor name already exists, warn and drop |
92 |
| - * it.) |
| 91 | + * context. |
93 | 92 | */
|
94 |
| - portal = CreatePortal(stmt->portalname, true, false); |
| 93 | + portal = CreatePortal(stmt->portalname, false, false); |
95 | 94 |
|
96 | 95 | oldContext = MemoryContextSwitchTo(PortalGetHeapMemory(portal));
|
97 | 96 |
|
@@ -168,13 +167,10 @@ PerformPortalFetch(FetchStmt *stmt,
|
168 | 167 | portal = GetPortalByName(stmt->portalname);
|
169 | 168 | if (!PortalIsValid(portal))
|
170 | 169 | {
|
171 |
| - /* FIXME: shouldn't this be an ERROR? */ |
172 |
| - ereport(WARNING, |
| 170 | + ereport(ERROR, |
173 | 171 | (errcode(ERRCODE_UNDEFINED_CURSOR),
|
174 |
| - errmsg("portal \"%s\" does not exist", stmt->portalname))); |
175 |
| - if (completionTag) |
176 |
| - strcpy(completionTag, stmt->ismove ? "MOVE 0" : "FETCH 0"); |
177 |
| - return; |
| 172 | + errmsg("cursor \"%s\" does not exist", stmt->portalname))); |
| 173 | + return; /* keep compiler happy */ |
178 | 174 | }
|
179 | 175 |
|
180 | 176 | /* Adjust dest if needed. MOVE wants destination None */
|
@@ -218,11 +214,10 @@ PerformPortalClose(const char *name)
|
218 | 214 | portal = GetPortalByName(name);
|
219 | 215 | if (!PortalIsValid(portal))
|
220 | 216 | {
|
221 |
| - ereport(WARNING, |
| 217 | + ereport(ERROR, |
222 | 218 | (errcode(ERRCODE_UNDEFINED_CURSOR),
|
223 |
| - errmsg("portal \"%s\" does not exist", name), |
224 |
| - errfunction("PerformPortalClose"))); /* for ecpg */ |
225 |
| - return; |
| 219 | + errmsg("cursor \"%s\" does not exist", name))); |
| 220 | + return; /* keep compiler happy */ |
226 | 221 | }
|
227 | 222 |
|
228 | 223 | /*
|
|
0 commit comments