Re: Recording foreign key relationships for the system catalogs

From: "Joel Jacobson" <joel(at)compiler(dot)org>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Recording foreign key relationships for the system catalogs
Date: 2021-02-01 19:47:34
Message-ID: c5a51894-47a0-4f7f-8a36-973dfa720498@www.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Feb 1, 2021, at 20:33, Joel Jacobson wrote:
>Suggestions on how to fix:
>
>* Make is_array an boolean[], and let each element represent the is_array value for each fkcols element.
>
>* Change interface to be more like information_schema, and add a "ordinal_position" column, and return each column on a separate row.
>
>I think I prefer the latter since it's more information_schema-conformant, but any works.

Ops. I see a problem with just adding a "ordinal_position", since then one would also need enumerate the "foreing key" constraints or give them names like "constraint_name" in information_schema.table_constraints (since there can be multiple foreign keys per fktable, so there would be multiple e.g. ordinal_position=1 per fktable).

With this into consideration, I think the easiest and cleanest solution is to make is_array a boolean[].

I like the usage of arrays, it makes it much easier to understand the output,
as it's the visually easy to see what groups of columns that references what group of columns.

/Joel

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-02-01 19:58:34 Re: [sqlsmith] Failed assertion during partition pruning
Previous Message Joel Jacobson 2021-02-01 19:33:26 Re: Recording foreign key relationships for the system catalogs