Re: Surround CheckRelation[Oid]LockedByMe() with USE_ASSERT_CHECKING

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Surround CheckRelation[Oid]LockedByMe() with USE_ASSERT_CHECKING
Date: 2024-07-01 14:38:44
Message-ID: ZoK/dHwIpPiNIHzv@ip-10-97-1-34.eu-west-3.compute.internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Mon, Jul 01, 2024 at 10:21:35AM -0400, Tom Lane wrote:
> Michael Paquier <michael(at)paquier(dot)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.

Yeah good point, thanks for the feedback! I've withdrawn the CF entry.

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-07-01 14:43:53 Re: Should we document how column DEFAULT expressions work?
Previous Message Alvaro Herrera 2024-07-01 14:35:02 Re: LogwrtResult contended spinlock