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

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Dominique Devienne <ddevienne(at)gmail(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 17:22:22
Message-ID: 5236c5b3-c760-0d33-ae7d-a854d36f1e83@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 3/24/23 9:44 AM, Dominique Devienne wrote:
> On Fri, Mar 24, 2023 at 5:40 PM Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com
> <mailto: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>
> > <mailto: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.

There was no offense taken, it was about confusion as to what was being
asked?

>
> 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.

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Miles Elam 2023-03-24 21:18:38 Re: PostgreSQL vs MariaDB
Previous Message Dominique Devienne 2023-03-24 16:44:04 Re: Convert pg_constraint.conkey array to same-order array of column names