From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: shihao zhong <zhong950419@gmail.com>
Cc: Atisss hh <125atishprak@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19849: queries fail after ANALYZE with expression stats on arrays
Date: Wed, 11 Nov 2026 07:33:30 +0900
Message-ID: <avObuoda1a9JRpBi@paquier.xyz> (raw)
In-Reply-To: <2925331.1794336781@sss.pgh.pa.us>
References: <19849-38b8bd2fea807154@postgresql.org>
<CAGqfTtvt=d-aCEnVE1zRDMpUO9SyL3mAuCYzwdJodoNd0B5w8w@mail.gmail.com>
<CAGRkXqSbfQ4nbaf5jh4cxoEBZX86iLjoVhdCBqH0J_Osviskyg@mail.gmail.com>
<avFekPK2YMzo_l6V@paquier.xyz>
<2492770.1794253395@sss.pgh.pa.us>
<CAGRkXqSbEG3M-Nfop4P-n+Mq16EebEH3EK3AP+qwiH8zMoKgWQ@mail.gmail.com>
<avK1Yn8px0eAqiPQ@paquier.xyz>
<2925331.1794336781@sss.pgh.pa.us>
On Tue, Nov 10, 2026 at 01:53:01PM -0500, Tom Lane wrote:
> Yeah, I didn't love this particular refactorization either. I think
> it'd be nicer to have the values[] and nulls[] arrays totally inside
> the shared function and do the tuple-building within it, as attached.
Including the tuple build in the routine sounds good here. That takes
care of my worries with the previous patch.
> One thing that bugs me slightly about this is that it seems weird to
> be passing starelid and stainherit explicitly while digging staattnum
> out of the VacAttrStats struct. It works, because examine_expression
> is careful to set stats->tupattnum = InvalidAttrNumber, but maybe
> it would be cleaner to pass all three parts of the primary key as
> explicit arguments. Does anyone else feel that way?
None here. Passing down tupattnum as an argument coming from "stats"
also felt a bit strange..
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
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: michael@paquier.xyz, tgl@sss.pgh.pa.us, zhong950419@gmail.com, 125atishprak@gmail.com
Subject: Re: BUG #19849: queries fail after ANALYZE with expression stats on arrays
In-Reply-To: <avObuoda1a9JRpBi@paquier.xyz>
References: <19849-38b8bd2fea807154@postgresql.org> <CAGqfTtvt=d-aCEnVE1zRDMpUO9SyL3mAuCYzwdJodoNd0B5w8w@mail.gmail.com> <CAGRkXqSbfQ4nbaf5jh4cxoEBZX86iLjoVhdCBqH0J_Osviskyg@mail.gmail.com> <avFekPK2YMzo_l6V@paquier.xyz> <2492770.1794253395@sss.pgh.pa.us> <CAGRkXqSbEG3M-Nfop4P-n+Mq16EebEH3EK3AP+qwiH8zMoKgWQ@mail.gmail.com> <avK1Yn8px0eAqiPQ@paquier.xyz> <2925331.1794336781@sss.pgh.pa.us> <avObuoda1a9JRpBi@paquier.xyz>
* 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