Restore support for USE_ASSERT_CHECKING in extensions only

Andrew Kane <andrew@ankane.org>

From: Andrew Kane <andrew@ankane.org>
To: pgsql-hackers@postgresql.org
Date: 2025-01-10T22:26:50Z
Lists: pgsql-hackers

Attachments

Prior to 6f3820f, extensions could be compiled with -DUSE_ASSERT_CHECKING
whether or not the Postgres installation was configured with
--enable-cassert (to enable at least some assertion checking). However,
after 6f3820f, linking fails with `undefined symbol:
verify_compact_attribute`. I'm not sure if this use case is officially
supported, but it has been helpful for developing pgvector.

The attached patch fixes it, but there may be a better way to do this.

Commits

  1. Make verify_compact_attribute available in non-assert builds