Re: Using ASSUME in place of ASSERT in non-assert builds

2025-07-10 Thread Andres Freund
Hi, On 2025-07-10 16:24:08 +0200, Benjamin Coutu wrote: > I noticed that Andres recently introduced pg_assume into the codebase - > great addition! > > That got me thinking: some projects (like PHP) map the ASSERT macro to > ASSUME in non-assert builds. The rationale is that ASSERT typically > exp

Re: Using ASSUME in place of ASSERT in non-assert builds

2025-07-10 Thread Tom Lane
Benjamin Coutu writes: > That got me thinking: some projects (like PHP) map the ASSERT macro to ASSUME > in non-assert builds. The rationale is that ASSERT typically expresses a > tautology, something the programmer believes to be always true. So in builds > where assertions are compiled out, w

Using ASSUME in place of ASSERT in non-assert builds

2025-07-10 Thread Benjamin Coutu
Hello, I noticed that Andres recently introduced pg_assume into the codebase - great addition! That got me thinking: some projects (like PHP) map the ASSERT macro to ASSUME in non-assert builds. The rationale is that ASSERT typically expresses a tautology, something the programmer believes to