rename and move AssertVariableIsOfType

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: rename and move AssertVariableIsOfType
Date: 2026-01-26 12:17:15
Message-ID: 2273bc2a-045d-4a75-8584-7cd9396e5534@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I'm proposing two changes:

First, rename AssertVariableIsOfType to StaticAssertVariableIsOfType.
The current name suggests that it is a run-time assertion (like
"Assert"), but it's not. The name change makes that clearer.

I doubt that the current name is used in many extensions, but if
necessary, extension code could adapt to this quite easily with
something like

#if PG_VERSION_NUM < ...
#define StaticAssertVariableIsOfType(x, y) AssertVariableIsOfType(x, y)
#endif

Second, change the underlying implementation of
StaticAssertVariableIsOfType to use StaticAssertDecl instead of
StaticAssertStmt. This makes StaticAssertVariableIsOfType behave more
like a normal static assertion, and in many cases we can move the
current instances to a more natural position at file scope. This is
similar to previous commits like 493eb0da31b.

Attachment Content-Type Size
0001-Rename-AssertVariableIsOfType-to-StaticAssertVariabl.patch text/plain 22.4 KB
0002-Change-StaticAssertVariableIsOfType-to-be-a-declarat.patch text/plain 9.7 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2026-01-26 12:22:04 Re: AIX support
Previous Message Zsolt Parragi 2026-01-26 12:06:36 Re: [oauth] Stabilize the libpq-oauth ABI (and allow alternative implementations?)