Re: Convert pg_constraint.conkey array to same-order array of column names - Mailing list pgsql-general

From Dominique Devienne
Subject Re: Convert pg_constraint.conkey array to same-order array of column names
Date
Msg-id CAFCRh--8y2JYoqrrX3Pren2S8+ygTkSwozMCwxsnRXs3HKxHsA@mail.gmail.com
Whole thread Raw
In response to Re: Convert pg_constraint.conkey array to same-order array of column names  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-general
On Fri, Mar 24, 2023 at 11:51 AM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
On 2023-Mar-23, Dominique Devienne wrote:
> But I'm wondering about getting 1 row per constraint instead,
> and fetching an array of column names.

IIRC you can use array_agg(unnest ORDER BY ordinality), grouping by
constraint OID or name.
 
Thanks. This lead me to a better search, yielding two informative results:

pgsql-general by date:

Previous
From: Inzamam Shafiq
Date:
Subject: PostgreSQL vs MariaDB
Next
From: Christophe Pettus
Date:
Subject: Re: Oracle to PostgreSQL Migration