Re: Question about WITH ORDINALITY and unnest

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Mike Martin <redtux1(at)gmail(dot)com>
Cc: pgsql-sql <pgsql-sql(at)lists(dot)postgresql(dot)org>
Subject: Re: Question about WITH ORDINALITY and unnest
Date: 2021-01-23 16:14:19
Message-ID: CAKFQuwZpWf8SKrqLB3e4CFuLNinRM2-Ouy-xT84CTyO55CkeHA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Saturday, January 23, 2021, Mike Martin <redtux1(at)gmail(dot)com> wrote:
>
>
> Is there any way to make the ordinality ordering to be over the entire
> record set rather than per array
>

No

>
> (the idea is to combine two arrays of varying dimensions into one, keeping
> order)
>
> I have got a working solution by adding a rowid and ordering the array by
> eg: rowid+nr (where rowid is 100,200, big enough not to be in record set)
>

Yep, this is what I often do as well.

David J.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Shaozhong SHI 2021-01-23 21:14:11 Re: Question about WITH ORDINALITY and unnest
Previous Message Mike Martin 2021-01-23 13:17:09 Question about WITH ORDINALITY and unnest