Re: Convert pg_constraint.conkey array to same-order array of column names

From: Dominique Devienne <ddevienne(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Convert pg_constraint.conkey array to same-order array of column names
Date: 2023-03-24 16:44:04
Message-ID: CAFCRh-_zr5QFFjxXA5sPN90B9KKb6pjL6jwc2A+NtAH5jqRfaA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Mar 24, 2023 at 5:40 PM Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
wrote:

> On 3/24/23 03:28, Dominique Devienne wrote:
> > On Thu, Mar 23, 2023 at 4:20 PM Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com
> > <mailto:adrian(dot)klaver(at)aklaver(dot)com>> wrote:
> Your original question was:
>
> "But I'm wondering about getting 1 row per constraint instead,
> and fetching an array of column names.
>
> So is there a way to "convert" int2[] conkey array into a text[] of those
> column names?"
>
> That is what I showed as a simple example.
>

Sorry, didn't mean to offend you.

My post started with "preserving order of the columns",
but I probably didn't make it clear enough preserving the source array's
order was also a requirement.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2023-03-24 17:22:22 Re: Convert pg_constraint.conkey array to same-order array of column names
Previous Message Adrian Klaver 2023-03-24 16:40:15 Re: Convert pg_constraint.conkey array to same-order array of column names