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

Поиск
Список
Период
Сортировка
От PG Bug reporting form
Тема BUG #16528: Analytical function with Over clause for ARRAY datatype is not working properly
Дата
Msg-id 16528-8ddc2c3ee591a2bb@postgresql.org
обсуждение исходный текст
Ответы Re: BUG #16528: Analytical function with Over clause for ARRAY datatype is not working properly  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      16528
Logged by:          Manvendra Panwar
Email address:      manvendra2525@gmail.com
PostgreSQL version: 11.8
Operating system:   Ubuntu 18.04.1 LTS
Description:

postgres=# create table array_order (a int[], b float[], c bool[]);
CREATE TABLE
postgres=# insert into array_order values
(array[935,181,326,103],array[38766.318,54516.453,9546.79,276.63],array[false,true]);
INSERT 0 1
postgres=# insert into array_order values
(array[935,181,326,103],array[38767.318,54517.453,9540.79,270.63],array[false,true]);
INSERT 0 1
postgres=# insert into array_order values
(array[935,181,326,104],array[38767.348,54517.443,9540.49,270.43],array[true]
     );
INSERT 0 1
postgres=# commit;

postgres=# select * from array_order;
         a         |                  b                   |   c
-------------------+--------------------------------------+-------
 {935,181,326,103} | {38766.318,54516.453,9546.79,276.63} | {f,t}
 {935,181,326,103} | {38767.318,54517.453,9540.79,270.63} | {f,t}
 {935,181,326,104} | {38767.348,54517.443,9540.49,270.43} | {t}
(3 rows)

-- 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;
         a         |                  b                   | rank | Dense
Rank
-------------------+--------------------------------------+------+------------
 {935,181,326,103} | {38766.318,54516.453,9546.79,276.63} |    1 |
1
 {935,181,326,103} | {38767.318,54517.453,9540.79,270.63} |    1 |
1
 {935,181,326,104} | {38767.348,54517.443,9540.49,270.43} |    3 |
2
(3 rows)

-- 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;
         a         |                  b                   | rank | Dense
Rank
-------------------+--------------------------------------+------+------------
 {935,181,326,103} | {38766.318,54516.453,9546.79,276.63} |    1 |
1
 {935,181,326,103} | {38767.318,54517.453,9540.79,270.63} |    1 |
1
 {935,181,326,104} | {38767.348,54517.443,9540.49,270.43} |    1 |
1
(3 rows)


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

Предыдущее
От: Dmitry Dolgov
Дата:
Сообщение: Re: BUG #16500: SQL Abend. select multi_key_columns_range_partition_table
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #16528: Analytical function with Over clause for ARRAY datatype is not working properly