Re: Surround CheckRelation[Oid]LockedByMe() with USE_ASSERT_CHECKING - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Surround CheckRelation[Oid]LockedByMe() with USE_ASSERT_CHECKING
Date
Msg-id 2736704.1719843695@sss.pgh.pa.us
Whole thread Raw
In response to Re: Surround CheckRelation[Oid]LockedByMe() with USE_ASSERT_CHECKING  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Surround CheckRelation[Oid]LockedByMe() with USE_ASSERT_CHECKING
List pgsql-hackers
Michael Paquier <michael@paquier.xyz> writes:
> On Mon, Jul 01, 2024 at 06:42:46AM +0000, Bertrand Drouvot wrote:
>> I think it would make sense to declare / define those functions only for
>> assert enabled build: please find attached a tiny patch doing so.

> Not convinced that's a good idea.  What about out-of-core code that
> may use these routines for runtime checks in non-assert builds?

Yeah.  Also, I believe it's possible for an extension that's been
built with assertions enabled to be used with a core server that
wasn't.  This is why, for example, ExceptionalCondition() is not
ifdef'd away in a non-assert build.  Even if you think there's
no use for CheckRelation[Oid]LockedByMe except in assertions,
it'd still be plenty reasonable for an extension to call them
in assertions.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Stepan Neretin
Date:
Subject: Re: gamma() and lgamma() functions
Next
From: Daniel Gustafsson
Date:
Subject: Re: gamma() and lgamma() functions