The if() statement at line 418 in pquery.c seems a bit bereft of
controlled statement; looks like a broken log_executor_stats patch.

	if (portal->strategy != PORTAL_MULTI_QUERY)
	{
		ereport(DEBUG3,
			(errmsg_internal("PortalRun")));
		/* PORTAL_MULTI_QUERY logs its own stats per query */
		if (log_executor_stats)
			ResetUsage();
	}
	
--->	if (log_executor_stats && portal->strategy != PORTAL_MULTI_QUERY)

	/*
	 * Check for improper portal use, and mark portal active.
	 */
	if (portal->portalDone)
		ereport(ERROR,
				(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
		   errmsg("portal \"%s\" cannot be run anymore", portal->name)));

			regards, tom lane

Thu, 18 Mar 2004 16:28:36 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Broken code in pquery.c

Thanks.  Fixed.  Not sure how it happened.

---------------------------------------------------------------------------

Tom Lane wrote:
> The if() statement at line 418 in pquery.c seems a bit bereft of
> controlled statement; looks like a broken log_executor_stats patch.
> 
> 	if (portal->strategy != PORTAL_MULTI_QUERY)
> 	{
> 		ereport(DEBUG3,
> 			(errmsg_internal("PortalRun")));
> 		/* PORTAL_MULTI_QUERY logs its own stats per query */
> 		if (log_executor_stats)
> 			ResetUsage();
> 	}
> 	
> --->	if (log_executor_stats && portal->strategy != PORTAL_MULTI_QUERY)
> 
> 	/*
> 	 * Check for improper portal use, and mark portal active.
> 	 */
> 	if (portal->portalDone)
> 		ereport(ERROR,
> 				(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
> 		   errmsg("portal \"%s\" cannot be run anymore", portal->name)));
> 
> 			regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Thu, 18 Mar 2004 18:26:29 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: Broken code in pquery.c