Re: ORDER BY col is NULL in UNION causes error?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: ORDER BY col is NULL in UNION causes error?
Дата
Msg-id 20070111202150.GF10464@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: ORDER BY col is NULL in UNION causes error?  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: ORDER BY col is NULL in UNION causes error?  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-general
Bruce Momjian wrote:

> Here the column result is an expression, and you reference that.
> Updated wording:
>
>  test=> select * from test union select * from test order by x is null;
>  ERROR:  A UNION/INTERSECT/EXCEPT ORDER BY cannot use expressions or functions, only result column names

This seems at odds with our message style guidelines.  I'd suggest
putting the actual error message in errmsg() and the rest as a errhint,
maybe

(errmsg("invalid UNION/INTERSECT/EXCEPT ORDER BY clause"),
 errhint("You may specify only output result column names in the ORDER BY clauses."))

or something like that.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

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

Предыдущее
От: "Jeanna Geier"
Дата:
Сообщение: Re: Problems With VIEWS
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: TRIGGER BEFORE INSERT