public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: Егор Будюкин <[email protected]>
Cc: [email protected]
Subject: Re: Confusion on Assert() definition
Date: Wed, 26 Mar 2025 10:39:56 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAAv0m28UaDUMLiaHMuSrhQDQAo-6gmBraaHBARi4XOuk4nOPQg@mail.gmail.com>
References: <CAAv0m28UaDUMLiaHMuSrhQDQAo-6gmBraaHBARi4XOuk4nOPQg@mail.gmail.com>
=?UTF-8?B?0JXQs9C+0YAg0JHRg9C00Y7QutC40L0=?= <[email protected]> writes:
> There's something about the definition of Assert() in postgres that I
> don't really understand.
Asserts are meant to be used for "can't happen" cases that would
represent programming bugs. As such, they are made to do something
in debug builds but be no-ops in production builds. If you think
there's actually a realistic chance of the case happening in a
production context, you should use a regular if-test-and-ereport
instead of an Assert.
regards, tom lane
view thread (2+ messages)
reply
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Confusion on Assert() definition
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox