Re: array UNNESTed to rows stable with respect to order?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: array UNNESTed to rows stable with respect to order?
Дата
Msg-id CAKFQuwYNER-h8qRN33+CLTfP0k8oYhTZhaTig=Gt3Oez2bHJWA@mail.gmail.com
обсуждение исходный текст
Ответ на array UNNESTed to rows stable with respect to order?  (Thiemo Kellner <thiemo@gelassene-pferde.biz>)
Ответы Re: array UNNESTed to rows stable with respect to order?  ("Thiemo Kellner, NHC Barhufpflege"<thiemo.kellner@gelassene-pferde.biz>)
Список pgsql-general
On Tue, Apr 17, 2018 at 1:20 PM, Thiemo Kellner <thiemo@gelassene-pferde.biz> wrote:
This works fine but I am not sure whether the ordering remains in the later use.

​It does not.  If the array is not naturally ordered you will want to attach a "with ordinality" clause to it for performing future ordering.

select * from unnest(ARRAY[3,6,4]::integer[]) with ordinality

Use LATERAL to move the unnest from the select-list section to the FROM clause.

​David J.

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

Предыдущее
От: Thiemo Kellner
Дата:
Сообщение: array UNNESTed to rows stable with respect to order?
Следующее
От: Paul Jungwirth
Дата:
Сообщение: Re: array UNNESTed to rows stable with respect to order?