On Tue, Apr 17, 2018 at 1:20 PM, Thiemo Kellner <thiemo(at)gelassene-pferde(dot)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.