X-Original-To: pgsql-bugs-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 01A659DC89D; Thu, 23 Mar 2006 00:27:14 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 24512-10; Thu, 23 Mar 2006 00:27:13 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 736019DC85F; Thu, 23 Mar 2006 00:27:12 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id k2N4RBsD002743; Wed, 22 Mar 2006 23:27:11 -0500 (EST) To: "Davidson, Robert" cc: pgsql-sql@postgresql.org, pgsql-bugs@postgresql.org Subject: Re: [SQL] Function Parameters in GROUP BY clause cause errors In-reply-to: <20117.1143064428@sss.pgh.pa.us> References: <8333C841129E074E9F83FC80676BA76E0BF08D@exchg-sea3-03.ant.amazon.com> <20117.1143064428@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 22 Mar 2006 16:53:48 -0500" Date: Wed, 22 Mar 2006 23:27:11 -0500 Message-ID: <2742.1143088031@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.114 required=5 tests=[AWL=0.114] X-Spam-Score: 0.114 X-Spam-Level: X-Archive-Number: 200603/189 X-Sequence-Number: 14675 I wrote: > Hmm, this seems like a plpgsql deficiency. It feels it can generate a > separate parameter symbol ($n) for each occurrence of each variable it > passes into a SQL query. But for this query to be legal, the two > instances of IntervalMinutes have to be represented by the *same* > parameter symbol (notice they are not in the regurgitated query). > It would be more efficient anyway to not generate multiple parameters > for the same value, so we oughta fix this. Patch applied to HEAD and 8.1 branches. regards, tom lane