Re: Interesting CREATE TABLE AS misbehavior

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: Interesting CREATE TABLE AS misbehavior
Дата
Msg-id 20060918133043.GA24675@kenobi.snowman.net
обсуждение исходный текст
Ответ на Interesting CREATE TABLE AS misbehavior  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Interesting CREATE TABLE AS misbehavior  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Interesting CREATE TABLE AS misbehavior  ("Jim C. Nasby" <jimn@enterprisedb.com>)
Список pgsql-hackers
* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> The reason for this behavior is that analyze.c attaches the CREATE TABLE
> AS aliases to the targetlist (via applyColumnNames) before it processes
> the ORDER BY clause.  (So, "order by z2" works instead.)  This seems
> like a bug: one would expect that the aliases do not change the
> semantics of the SELECT part of the command.

I'd tend to agree that it seems like a bug but I'm a little mystified as
to why an 'order by' would be desired (or allowed) for a 'create table as'
at all.  Allowing it seems to imply it has some meaning.

Just my 2c,
Stephen

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Gregory Stark
Дата:
Сообщение: Limited Sort
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: [pgsql-www] Developer's Wiki