Re: Are sub-select error suppressed?

From: dev(at)archonet(dot)com
To: "Stephan Szabo" <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: "Richard Huxton" <dev(at)archonet(dot)com>, "patrick" <patrick+pgsql(at)boxsoft(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Are sub-select error suppressed?
Date: 2002-11-26 17:04:33
Message-ID: 1081.192.168.1.16.1038330273.squirrel@mainbox.archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> On Tue, 26 Nov 2002, Richard Huxton wrote:
>
>> On Tuesday 26 Nov 2002 9:43 am, patrick wrote:
>> > Greetings,
>> >
>> > I'm not sure what the correct behavior is here but the observed
>> > behavior seems "wrong" (or at least undesirable).

>> Don't look right to me, and I still see it here in 7.2 and the 7.3 beta
>> I've
>> got (note - not most recent). I don't think it's in the subselect itself
>> -
>> what's happening is when you do
>
> I think it's standard behavior. The column reference is an outer
> reference I believe, IIRC all the names from the outer query are in scope
> in the subselect (although if there's an equivalent name in the subselect
> from tables you'd have to qualify it).

Ah - of course. Otherwise you couldn't do a subselect where foo=outer_foo.
It tries to bind within the subselect, fails, then binds to the outer
clause.

Obvious now Stephan's pointed it out. Also reminds me why I like table
aliases for any complicated queries.

- Richard Huxton

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Rob Hills 2002-11-26 17:18:02 Re: How does postgres handle non literal string values
Previous Message Stephan Szabo 2002-11-26 16:11:53 Re: join question