Re: [HACKERS] [6.5.3] 'attribute not found'

From: Don Baccus <dhogaza(at)pacifier(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, The Hermit Hacker <scrappy(at)hub(dot)org>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] [6.5.3] 'attribute not found'
Date: 2000-01-28 04:55:56
Message-ID: 3.0.1.32.20000127205556.00ea9070@mail.pacifier.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)pacifier(dot)com>
Nature photos, on-line guides, Pacific Northwest
Rare Bird Alert Service and other goodies at
http://donb.photo.net.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2000-01-28 04:56:57 Re: [HACKERS] OR-of-ANDs dragon slain ... or at least seriously wounded ...
Previous Message Bruce Momjian 2000-01-28 04:51:03 Re: [HACKERS] very minor problem in contrib/dateformat/to-from_char.c