From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Kyle <kyle(at)actarg(dot)com>, pgsql-sql(at)postgresql(dot)org |
Subject: | Re: A query that doesn't work on 7.1 |
Date: | 2001-03-08 01:54:59 |
Message-ID: | 24466.984016499@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
>> Here's a query that doesn't work on 7.1. Is this a bug or am I doing
>> something wrong?
> Hmm, I think you have found some subtle bugs in aggregate processing;
> offhand it seems like both these queries should be legal. I'll see what
> I can do about it.
Not so subtle after all :-(. Curious that no one noticed this before.
Here's the patch if you need it right away...
regards, tom lane
*** src/backend/optimizer/util/clauses.c.orig Mon Feb 12 20:26:43 2001
--- src/backend/optimizer/util/clauses.c Wed Mar 7 20:49:01 2001
***************
*** 540,545 ****
--- 540,553 ----
Query *context)
{
if (node == NULL)
+ return false;
+
+ /*
+ * If we find an aggregate function, do not recurse into its
+ * arguments. Subplans invoked within aggregate calls are allowed
+ * to receive ungrouped variables.
+ */
+ if (IsA(node, Aggref))
return false;
/*
From | Date | Subject | |
---|---|---|---|
Next Message | guard | 2001-03-08 04:29:55 | postgresql beta-4,5 BUG |
Previous Message | Roberto Mello | 2001-03-08 01:03:54 | Re: quotes in pl/pgsql |