Re: attndims, typndims still not enforced, but make the value within a sane threshold

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, jian he <jian(dot)universality(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Kirill Reshke <reshkekirill(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: attndims, typndims still not enforced, but make the value within a sane threshold
Date: 2025-01-21 21:30:17
Message-ID: 3485415.1737495017@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> I wonder if we should try to fix the GIN AM to avoid that.
> The column being indexed is of an array type in these cases, but the
> index entries aren't. It seems inconsistent that it sets up the index
> column's attndims and atttypid this way.

Ah, I see the problem: it's not GIN's fault, it's that index.c's
ConstructTupleDescriptor is very sloppy about setting attndims
in some places and not others. Fortunately it's quite cheap to
fix that, since the places where this is missed already have their
hands on the pg_type entry for the index column's type. See v2
attached (now with a regression test).

regards, tom lane

Attachment Content-Type Size
v2-preserve-attndims-better.patch text/x-diff 11.1 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Treat 2025-01-21 22:45:02 Re: XMLDocument (SQL/XML X030)
Previous Message Jeff Davis 2025-01-21 21:26:52 Re: Proposal: "query_work_mem" GUC, to distribute working memory to the query's individual operators