From: Michael Paquier <michael@paquier.xyz>
To: Matthias van de Meent <boekewurm+postgres@gmail.com>
Cc: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Sivaprasad <sivaprasad.postgres@gmail.com>
Subject: Re: BUG: pg_class.relchecks overflow, making table undroppable
Date: Mon, 28 Sep 2026 06:56:46 +0900
Message-ID: <armRHds2MDhCUD2N@paquier.xyz> (raw)
In-Reply-To: <CAEze2Why2Y5iBoTP=N6AEzOXuzzQ=HpD0tmhHsf6KDRKPW7cwg@mail.gmail.com>
References: <CAEze2WjSW4qaHYnvkTtbknp85eGEirGJTLMZatotdJJKiA+_hA@mail.gmail.com>
<arWrSl3XON1pTGNp@paquier.xyz>
<arYzwtRf+S9h5UQm@bdtpg>
<arY5KKfzODnXJ-eG@paquier.xyz>
<CAEze2Why2Y5iBoTP=N6AEzOXuzzQ=HpD0tmhHsf6KDRKPW7cwg@mail.gmail.com>
On Fri, Sep 25, 2026 at 02:33:57PM +0200, Matthias van de Meent wrote:
> Also done. Thanks for the fast replies.
>
> Attached v3:
>
> * Add errcode(PROGRAM_LIMIT_EXCEEDED) to the ereports.
> * Use pg_add_s16_overflow() to detect the overflows.
> This includes changing the type of local numchecks variables to
> int16. SetRelationNumChecks's signature is unchanged.
> * Move the overflow checks to before StoreRelCheck.
> This saves one dirty tuple in catalog tables when that overflow happens.
That looks pretty good here, so applied and backpatched as the
consequences of keeping an overflowed counter can be really annoying.
--
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-hackers@postgresql.org
Cc: michael@paquier.xyz, boekewurm+postgres@gmail.com, bertranddrouvot.pg@gmail.com, sivaprasad.postgres@gmail.com
Subject: Re: BUG: pg_class.relchecks overflow, making table undroppable
In-Reply-To: <armRHds2MDhCUD2N@paquier.xyz>
References: <CAEze2WjSW4qaHYnvkTtbknp85eGEirGJTLMZatotdJJKiA+_hA@mail.gmail.com> <arWrSl3XON1pTGNp@paquier.xyz> <arYzwtRf+S9h5UQm@bdtpg> <arY5KKfzODnXJ-eG@paquier.xyz> <CAEze2Why2Y5iBoTP=N6AEzOXuzzQ=HpD0tmhHsf6KDRKPW7cwg@mail.gmail.com> <armRHds2MDhCUD2N@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