Re: Erratic error message "ERROR: column "id_compte" does

From: David Pradier <dpradier(at)apartia(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Richard Huxton <dev(at)archonet(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Erratic error message "ERROR: column "id_compte" does
Date: 2005-03-16 16:14:32
Message-ID: 20050316161432.GI17220@apartia.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ok then, if it's per spec, nothing to say.
Thanks to everybody, Richard and Tom, for your time.

PS : well yes, i think it is reasonably weird. I sure don't want to try
and imagine the case you're proposing. Brain's too precious to burn. I'm
confident in you to be assured it's weirder and weirdest :-)

On Wed, Mar 16, 2005 at 10:17:17AM -0500, Tom Lane wrote:
> David Pradier <dpradier(at)apartia(dot)fr> writes:
> > One can access the columns of the main query from the subquery,
> > therefore in my own query the column "id_compte" is found,
> > therefore there is no error message.
>
> > Doesn't this count as a bug ?
>
> No; it's required behavior per the SQL specification. The spec doesn't
> restrict the sub-query to reference outer columns in only some places;
> it can use them anywhere.
>
> (If you think that's weird, you should try putting the outer reference
> in an aggregate function ... it then counts as an aggregate of the outer
> query, not the inner. Also per spec.)
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

--
dpradier(at)apartia(dot)fr - tel: 01.46.47.21.33 - fax: 01.46.47.21.37

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2005-03-16 16:23:08 Re: contrib/pg_buffercache
Previous Message Merlin Moncure 2005-03-16 15:59:18 Re: PQexecParams