Re: should check interrupts in BuildRelationExtStatistics ? - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: should check interrupts in BuildRelationExtStatistics ?
Date
Msg-id YsTOGq30GhkWPCT+@paquier.xyz
Whole thread Raw
In response to Re: should check interrupts in BuildRelationExtStatistics ?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, Jul 05, 2022 at 07:37:03PM -0400, Tom Lane wrote:
> Nonetheless, it'd be a good idea to use an interruptible sort in
> as many places as we can.  If we don't mind YA copy of the qsort
> code, I'd be inclined to propose inventing qsort_interruptible
> which is like qsort_arg but also does CHECK_FOR_INTERRUPTS.
> (There seems no reason to support a non-arg version, since you
> can just pass NULL.)  Or we could redefine qsort_arg as allowing
> interrupts, but that might still carry some surprises for existing
> code.

Agreed to use a new and different API for this purpose.  It seems like
a tool where one could write some new code and use an interruptible
qsort() thinking that it is fine, still a preperly-documented API has
clear benefits.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: First draft of the PG 15 release notes
Next
From: Michael Paquier
Date:
Subject: Re: avoid multiple hard links to same WAL file after a crash