Is this example regarding aggregates sourced by subquery correct?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Is this example regarding aggregates sourced by subquery correct?
Дата
Msg-id CAKFQuwbAX=iO9QbpN7_jr+BnUWm9FYX8WbEPUvG0p+nZhp6TZg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Is this example regarding aggregates sourced by subquery correct?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-docs

"""
...This ordering is unspecified by default, but can be controlled by writing an ORDER BY clause within the aggregate call, as shown in Section 4.2.7. Alternatively, supplying the input values from a sorted subquery will usually work. For example:

SELECT xmlagg(x) FROM (SELECT x FROM test ORDER BY y DESC) AS tab;

But this syntax is not allowed in the SQL standard, and is not portable to other database systems.
"""

This seems incorrect - I was expecting something like:

SELECT xmlagg((SELECT x FROM test ORDER BY y DESC))

The example seems expressly permitted by the standard and other database systems.

I'll believe that said ordering in the example is not guaranteed but that isn't what it says.

David J.

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

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: contrib/intarray programlisting refers to pre-extension file
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Is this example regarding aggregates sourced by subquery correct?