On 04/17/2018 01:20 PM, Thiemo Kellner wrote:
> I use UNNEST to get rows from array. This works fine but I am
> not sure whether the ordering remains in the later use.
I think you are looking for `WITH ORDINALITY` (in pg 9.4+). For instance
you could rewrite your first CTE like so:
SELECT oid as PROOID,
PRONAME,
t as PROARGTYPE,
i,
PRONAMESPACE,
PROOWNER
FROM PG_CATALOG.PG_PROC,
UNNEST(PROARGTYPES) WITH ORDINALITY AS proargtypes(t, i)
;
Yours,
--
Paul ~{:-)
pj@illuminatedcomputing.com