Re: Restore support for USE_ASSERT_CHECKING in extensions only

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Andrew Kane <andrew@ankane.org>, pgsql-hackers@postgresql.org
Date: 2025-01-10T23:32:03Z
Lists: pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes:
> hmm, I didn't think of that scenario.  I think since
> verify_compact_attribute() does nothing when USE_ASSERT_CHECKING isn't
> defined that we might as well define a ((void) 0) macro to avoid the
> undefined symbol error. That'll avoid the useless call in your debug
> builds.

No, this completely fails to address the problem.  The concern is
that the extension has been compiled under USE_ASSERT_CHECKING,
so it will try to call the function.  If the function's not there
in core, kaboom.

What you need to do is provide an empty no-op version of
verify_compact_attribute() in non-assert builds.

			regards, tom lane



Commits

  1. Make verify_compact_attribute available in non-assert builds