Re: Bad error message

From: "Gurjeet Singh" <singh(dot)gurjeet(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Decibel! <decibel(at)decibel(dot)org>, "Pg Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bad error message
Date: 2008-10-01 05:12:28
Message-ID: 65937bea0809302212s30a8c114sd4763e3b525e160f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 1, 2008 at 9:39 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> "Gurjeet Singh" <singh(dot)gurjeet(at)gmail(dot)com> writes:
> > On Wed, Oct 1, 2008 at 3:07 AM, Decibel! <decibel(at)decibel(dot)org> wrote:
> >> ERROR: aggregates not allowed in WHERE clause
>
> > No, the real issue is that you are referencing the outer table's column's
> > max() in the inner query (correlated sub-query).
>
> Yeah. It's not easy to see how the software could guess your real
> intentions here. We could maybe offer a vaguely-worded HINT but I'm
> not able to think of wording that would be very helpful.

Can we do something like this in the code:

if( "level of the referenced column's relation" != "level of the
(sub)query being processed" )
errhint( "The subquery may be unintentionally referencing an outer
query's column!" );

Best regards,
--
gurjeet[(dot)singh](at)EnterpriseDB(dot)com
singh(dot)gurjeet(at){ gmail | hotmail | indiatimes | yahoo }.com

EnterpriseDB http://www.enterprisedb.com

Mail sent from my BlackLaptop device

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message KaiGai Kohei 2008-10-01 06:48:24 Updates of SE-PostgreSQL 8.4devel patches (r1076)
Previous Message Paul Schlie 2008-10-01 04:43:57 Re: Block-level CRC checks