From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <bruce@momjian.us>
Cc: Bruno Bonfils <asyd@asyd.net>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Cc: Alexey Bashtanov <alexey@brandwatch.com>
Subject: Re: About #13489, array dimensions and CREATE TABLE ... LIKE
Date: Tue, 21 Nov 2023 09:33:18 +0100
Message-ID: <9334a884530a0aa56f3a1e7fd24e995c415dab25.camel@cybertec.at> (raw)
In-Reply-To: <1403260.1700532781@sss.pgh.pa.us>
References: <ZD+14YZ4IUue8Rhi@gendo.asyd.net>
<ZPuN20z3HcBXdKow@momjian.us>
<ZVwI_ozT8z9MCnIZ@momjian.us>
<1402391.1700532261@sss.pgh.pa.us>
<ZVwQ6Fyh2SghkXja@momjian.us>
<1403260.1700532781@sss.pgh.pa.us>
On Mon, 2023-11-20 at 21:13 -0500, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > On Mon, Nov 20, 2023 at 09:04:21PM -0500, Tom Lane wrote:
> > > Bruce Momjian <bruce@momjian.us> writes:
> > > > An alternate approach would
> > > > be to remove pg_attribute.attndims so we don't even try to preserve
> > > > dimensionality.
>
> > > I could get behind that, perhaps. It looks like we're not using the
> > > field in any meaningful way, and we could simplify TupleDescInitEntry
> > > and perhaps some other APIs.
>
> > So should I work on that patch or do you want to try? I think we should
> > do something.
>
> Let's wait for some other opinions, first ...
Looking at the code, I get the impression that we wouldn't lose anything
without "pg_attribute.attndims", so +1 for removing it.
This would call for some documentation. We should remove most of the
documentation about the non-existing difference between declaring a column
"integer[]", "integer[][]" or "integer[3][3]" and just describe the first
variant in detail, perhaps mentioning that the other notations are
accepted for backward compatibility.
I also think that it would be helpful to emphasize that while dimensionality
does not matter to a column definition, it matters for individual array values.
Perhaps it would make sense to recommend a check constraint if one wants
to make sure that an array column should contain only a certain kind of array.
Yours,
Laurenz Albe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: laurenz.albe@cybertec.at, tgl@sss.pgh.pa.us, bruce@momjian.us, asyd@asyd.net, pgsql-hackers@postgresql.org, alexey@brandwatch.com
Subject: Re: About #13489, array dimensions and CREATE TABLE ... LIKE
In-Reply-To: <9334a884530a0aa56f3a1e7fd24e995c415dab25.camel@cybertec.at>
References: <ZD+14YZ4IUue8Rhi@gendo.asyd.net> <ZPuN20z3HcBXdKow@momjian.us> <ZVwI_ozT8z9MCnIZ@momjian.us> <1402391.1700532261@sss.pgh.pa.us> <ZVwQ6Fyh2SghkXja@momjian.us> <1403260.1700532781@sss.pgh.pa.us> <9334a884530a0aa56f3a1e7fd24e995c415dab25.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox