feat: version the shared library filename#232
Merged
Conversation
Following the PostGIS model, the shared library now includes the full semver version in its filename (e.g., pg_textsearch-1.0.0-dev.so). This allows multiple versions to coexist in $libdir and prevents undefined behavior when upgrading without restarting Postgres. The Makefile extracts the version from pg_textsearch.control's default_version and uses it to set MODULE_big. A new check-version target validates that module_pathname is consistent. Also fixes CreateParallelContext to use the versioned library name via a build-time macro, so parallel index build workers load the correct binary.
When upgrading from an unversioned binary (0.5.0) to a versioned one (1.0.0-dev), the existing C functions still reference $libdir/pg_textsearch. The upgrade script must recreate all functions with MODULE_PATHNAME so their probin switches to $libdir/pg_textsearch-1.0.0-dev. Also documents that future upgrade scripts must include function recreation whenever the library version changes.
Upgrade scripts must use CREATE OR REPLACE FUNCTION to update probin when the versioned library name changes. Ignore PS002 for upgrade scripts (--*--*.sql) while keeping the check for install scripts.
|
This looks good except I'd make one suggestion: have one sql file that can serve as both a install and an upgrade script and that's idempotent. That way the upgrade is just a symlink to the one sql. You can handle idempotentcy in sql logic. |
Collaborator
Author
Let me think about this as a followup? I know we did this in pgvectorscale, but the sql gets a lot more complex, so I've shied away from it so far. |
….2→0.5.0 - Add 0.5.0→0.5.1 and 0.5.1→1.0.0-dev upgrade scripts so users on v0.5.1 (patch release) can upgrade to 1.0.0-dev - Add bm25_debug_pageviz() to 0.4.2→0.5.0 upgrade script — the function was added during the 0.5.0 cycle but the upgrade script was not updated - Add v0.5.1 to upgrade-tests.yml matrix
tjgreen42
added a commit
that referenced
this pull request
Feb 24, 2026
This reverts commit cedd81c.
tjgreen42
added a commit
that referenced
this pull request
Feb 24, 2026
## Summary - Reverts #232 which added version numbers to the shared library filename - The versioned binary naming scheme (e.g., `pg_textsearch-1.0.0-dev.so`) caused problems in practice - Returns to the standard unversioned `pg_textsearch.so` naming ## Testing - `make installcheck` passes (all SQL regression + shell tests) - `make format-check` passes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pg_textsearch-1.0.0-dev.so), following the PostGIS modelpg_textsearch.controland derivesMODULE_bigfrom it;make check-versionvalidates consistencyCreateParallelContextto use a build-timePG_TEXTSEARCH_LIB_NAMEmacro instead of a hardcoded string, so parallel workers load the correct versioned binaryChanges
MakefileEXTVERSION, setMODULE_big, definePG_TEXTSEARCH_LIB_NAME, addcheck-versiontargetpg_textsearch.controlmodule_pathnamesrc/am/build_parallel.cPG_TEXTSEARCH_LIB_NAMEinCreateParallelContextscripts/package-deb.sh.so.github/workflows/{ci,release,package-release}.ymlRELEASING.mdCLAUDE.md