Re: [HACKERS] [6.5.3] 'attribute not found' - Mailing list pgsql-hackers

From Don Baccus
Subject Re: [HACKERS] [6.5.3] 'attribute not found'
Date
Msg-id 3.0.1.32.20000127205556.00ea9070@mail.pacifier.com
Whole thread Raw
In response to Re: [HACKERS] [6.5.3] 'attribute not found'  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
At 10:35 PM 1/27/00 -0500, Tom Lane wrote:

>> Should that not work?
>
>No, it shouldn't.  Labeling SELECT output columns with AS doesn't
>affect the namespace visible in the WHERE clause (since WHERE is
>"upstream" of the SELECT outputs). 

And I agree ... in other words, the where clause determines the rows
to be processed and returned to the target list.  

You are essentially asking that the result of the query be used as
a criterian for determining the result of the query...

> If we had sub-selects in FROM,
>I believe that AS would determine the column names seen outside
>the sub-select ("downstream").

Makes sense...

>
>Also, you can use the AS names in ORDER BY, which is also "downstream"
>of forming the results.  (I think we currently accept them in GROUP BY
>as well, but I suspect that that is not in compliance with the
>standard...)

After the discussion a few weeks ago I tried to decide by reading Date
(which I bought in part of the discussion, figuring it was about time)
and decided I couldn't tell for sure...

Now that I've got a draft copy of the ISO standard, maybe I'll find time
to dig into it.

May not be easy to decide for sure one way or the other...standards groups
occasionally leave such things more or less ambiguous as a means of moving
forward when dissenting parties (companies, usually) differ, in hopes that
in practice it won't matter.



- Don Baccus, Portland OR <dhogaza@pacifier.com> Nature photos, on-line guides, Pacific Northwest Rare Bird Alert
Serviceand other goodies at http://donb.photo.net.
 


pgsql-hackers by date:

Previous
From: Don Baccus
Date:
Subject: Re: [HACKERS] very minor problem in contrib/dateformat/to-from_char.c
Next
From: Chris Bitmead
Date:
Subject: Re: [HACKERS] Re: ORDBMS