Re: BUG #16528: Analytical function with Over clause for ARRAY datatype is not working properly

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #16528: Analytical function with Over clause for ARRAY datatype is not working properly
Дата
Msg-id 1355101.1594043329@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #16528: Analytical function with Over clause for ARRAY datatype is not working properly  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> -- WORKING FINE with ARRAY element
> postgres=# SELECT a , b, RANK() OVER (PARTITION BY c[0] ORDER BY a) Rank,
> DENSE_RANK() OVER (PARTITION BY c[0] ORDER BY a) "Dense Rank"  FROM
> array_order order by 3;

Note that "c[0]" is a constant NULL in this example, so all the
rows fall into the same partition.

> -- WITH ARRAY in PARTITION BY CLAUSE
> postgres=# SELECT a , b, RANK() OVER (PARTITION BY a ORDER BY a) Rank,
> DENSE_RANK() OVER (PARTITION BY a ORDER BY a) "Dense Rank"  FROM array_order
> order by 3;

In this case, rows with distinct "a" values belong to different
partitions.  Every row in a particular partition has the same "a"
value, so it's expected that they all have rank 1.

In short, I see no bug here.  "PARTITION BY a ORDER BY a" just
isn't a very useful window specification (independently of what
"a" is ...)

            regards, tom lane



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

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #16528: Analytical function with Over clause for ARRAY datatype is not working properly
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [bug] Table not have typarray when created by single user mode