Re: BUG #16548: Order by on array element giving disparity in result

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #16548: Order by on array element giving disparity in result
Дата
Msg-id 825164.1595340915@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #16548: Order by on array element giving disparity in result  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> postgres=# select * from bint order by a[2] desc limit 5;
>        a       
> ---------------
>  {14}
>  {10}
>  {14}
>  {10,14,10,10} 
>  {10,14,14,14} 
> (5 rows)

You failed to say what you think is a bug here, but I'm going
to guess that you're unhappy that this is not the same as
the first five rows of the not-limited sort output.  We do not
consider that a bug, because the sort key is very underspecified
here.  The first three rows share the same sort key (null) and
can legitimately come out in any order.  Likewise, rows with
a[2] = 14 can come out in any order.

The underlying implementation reason why it acts differently
is that sort-with-limit uses a different sorting method.

            regards, tom lane



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

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #16549: "CASE" not work properly , the function works properly on PostgreSQL 9.6.8
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Bug - 11.8