rename and move AssertVariableIsOfType
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2026-01-26T12:17:15Z
Lists: pgsql-hackers
Attachments
- 0001-Rename-AssertVariableIsOfType-to-StaticAssertVariabl.patch (text/plain) patch 0001
- 0002-Change-StaticAssertVariableIsOfType-to-be-a-declarat.patch (text/plain) patch 0002
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.
Commits
-
Change remaining StaticAssertStmt() to StaticAssertDecl()
- d50c86e74375 19 (unreleased) landed
-
Change StaticAssertVariableIsOfType to be a declaration
- 955e50766869 19 (unreleased) landed
-
Rename AssertVariableIsOfType to StaticAssertVariableIsOfType
- 137d05df2f20 19 (unreleased) landed