Re: should check interrupts in BuildRelationExtStatistics ?

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: should check interrupts in BuildRelationExtStatistics ?
Date: 2022-07-02 00:07:04
Message-ID: 20220702000704.GJ13040@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 01, 2022 at 07:19:11PM -0400, Tom Lane wrote:
> I tried interrupting at a random point and then stepping, and
> look what I hit after just a couple of steps:

I'd come up with the trick of setting
SET backtrace_functions='ProcessInterrupts';

> That, um, piqued my interest. After a bit of digging,
> I modestly propose the attached. I'm not sure if it's
> okay to back-patch this, because maybe someone out there
> is relying on qsort() to be incapable of throwing an error
> --- but it'd solve the problem at hand and a bunch of other
> issues of the same ilk.

Confirmed this fixes the 3 types of extended stats, at least for the example
cases I made.

If it's okay to backpatch, v14 seems adequate since the problem is more
prominent with expressional statistics (I'm sure that's why I hit it) ...
otherwise v15 would do.

--
Justin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Roberto Mello 2022-07-02 00:49:09 Re: Patch proposal: New hooks in the connection path
Previous Message Nathan Bossart 2022-07-01 23:40:27 Re: Allow placeholders in ALTER ROLE w/o superuser