Re: AssertLog instead of Assert in some places - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: AssertLog instead of Assert in some places
Date
Msg-id CAH2-WzkQgj65N501TigpUWfdLFWOL7ZKLcpSV-1djs1Kwvs2wA@mail.gmail.com
Whole thread Raw
In response to Re: AssertLog instead of Assert in some places  (Andres Freund <andres@anarazel.de>)
Responses Re: AssertLog instead of Assert in some places
List pgsql-hackers
On Fri, Aug 11, 2023 at 10:57 AM Andres Freund <andres@anarazel.de> wrote:
> I am quite strongly against this. This will lead to assertions being hit in
> tests without that being noticed, e.g. because they happen in a background
> process that just restarts.

Couldn't you say the same thing about defensive "can't happen" ERRORs?
They are essentially a form of assertion that isn't limited to
assert-enabled builds.

I have sometimes thought that it would be handy if there was a variant
of "can't happen" ERRORs that took on the structure of an assertion.
(This is quite different to what Ashutosh has proposed, though, since
it would still look like a conventional assertion failure on
assert-enabled builds.)

--
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [PATCH] Support static linking against LLVM
Next
From: Andres Freund
Date:
Subject: Re: AssertLog instead of Assert in some places