Re: xmlagg doesn't honor LIMIT?

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: xmlagg doesn't honor LIMIT?
Дата
Msg-id A737B7A37273E048B164557ADEF4A58B17C60299@ntex2010i.host.magwien.gv.at
обсуждение исходный текст
Ответ на xmlagg doesn't honor LIMIT?  (Peter Kroon <plakroon@gmail.com>)
Ответы Re: xmlagg doesn't honor LIMIT?  (Peter Kroon <plakroon@gmail.com>)
Список pgsql-general
Peter Kroon wrote:
> Is anyone able to reproduce?
> When I run the query below all 5 rows are returned instead of 2.
> Or is this the default behaviour..

> SELECT
> xmlagg(
[...]
> )--xmlagg
> FROM __pg_test_table AS dh
> WHERE dh.__rel=5 LIMIT 2 --OFFSET 10;

According to the documentation, that query should return
exactly one row since xmlagg is an aggregate.

So the LIMIT 2 won't do anything to the result.

You can wrap your query in a
SELECT count(*) FROM (SELECT ...) AS dummy;
to see how many rows you got.

Yours,
Laurenz Albe

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

Предыдущее
От: Albe Laurenz
Дата:
Сообщение: Re: Autodocumenting plpgsql function
Следующее
От: Nelson Green
Дата:
Сообщение: Re: Inserting rows containing composite foreign keys