Re: Defects with invalid stats data for expressions in extended stats

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Cc: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Tomas Vondra <tomas(at)vondra(dot)me>
Subject: Re: Defects with invalid stats data for expressions in extended stats
Date: 2026-02-27 07:33:24
Message-ID: aaFIxLbHgbm6Wo5m@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 27, 2026 at 02:51:40PM +0800, Chao Li wrote:
> Here stats itself is destroyed, but memory pointed by
> stats[0]~stats[i-1] are not free-ed, those memory are returned from
> examine_attribute() by palloc0_object().

I am aware of that. This is not done on simplicity ground, keeping
the cleanup of the memory context to ANALYZE in this case.

> “This function returns sets …”, is “returns” a typo and not needed?

That's a typo, thanks for re-reading.

> The comment says “this function does not use a function body”, but
> the function has a body. This appears in two places.

Let's just append a "SQL-standard" here, then.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2026-02-27 07:44:48 Re: SQL Property Graph Queries (SQL/PGQ)
Previous Message Michael Paquier 2026-02-27 07:25:41 Funny behavior in event trigger code with CREATE OR REPLACE VIEW and column additions