From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Don Baccus <dhogaza(at)pacifier(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org> |
Subject: | Re: column aliases |
Date: | 2000-06-08 02:58:53 |
Message-ID: | 200006080258.WAA09833@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
OK, seems it is resolved. We now throw a warning for the query.
> >> What it looks like to me is that we have a bug in the expansion of '*'.
> >> It should be generating columns for both the explicit and the implicit
> >> FROM clause, but it's evidently deciding that it should only produce
> >> output columns for the first one.
>
> I thought that the behavior had something to do with the fact that
> the underlying table was the same for both the explicit and the implicit
> rangetable entry, but not so. In fact, ExpandAllTables() deliberately
> refrains from expanding implicit entries, and always has AFAICT:
>
> /*
> * we only expand those listed in the from clause. (This will
> * also prevent us from using the wrong table in inserts: eg.
> * tenk2 in "insert into tenk2 select * from tenk1;")
> */
> if (!rte->inFromCl)
> continue;
>
> I think the comment in parentheses is no longer applicable, but there
> are other sources of implicit rangetable entries besides this particular
> feature --- rules and set functions both seem to add them. So I'm not
> sure what we might break by changing it.
>
> I'm inclined to leave this behavior alone, and go back to the idea of
> emitting warning notices when an implicit FROM clause is added.
>
> regards, tom lane
>
--
Bruce Momjian | http://www.op.net/~candle
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2000-06-08 03:05:46 | Re: column aliases |
Previous Message | Bruce Momjian | 2000-06-08 02:57:14 | Re: Implementing STDDEV and VARIANCE |