88 *
99 *
1010 * IDENTIFICATION
11- * $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.48 2002/02/27 19:35:16 tgl Exp $
11+ * $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.49 2002/02/27 19:52:41 tgl Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -158,7 +158,6 @@ ProcessQuery(Query *parsetree,
158158if (parsetree -> isPortal )
159159{
160160isRetrieveIntoPortal = true;
161- intoName = parsetree -> into ;
162161/* If binary portal, switch to alternate output format */
163162if (dest == Remote && parsetree -> isBinary )
164163dest = RemoteInternal ;
@@ -182,10 +181,12 @@ ProcessQuery(Query *parsetree,
182181 */
183182if (isRetrieveIntoPortal )
184183{
184+ intoName = parsetree -> into ;
185185portal = PreparePortal (intoName );
186186oldContext = MemoryContextSwitchTo (PortalGetHeapMemory (portal ));
187187parsetree = copyObject (parsetree );
188188plan = copyObject (plan );
189+ intoName = parsetree -> into ;/* use copied name in QueryDesc */
189190
190191/*
191192 * We stay in portal's memory context for now, so that query desc,