Fails to nmake on PostgreSQL 17 RC1 [Windows]
Problem
Tried installing pgvector on my new PostgreSQL 17 RC1. It fails to install on Windows when doing nmake: [code block] Works fine using PostgreSQL 16
Error Output
error LNK2019: unresolved external symbol float_to_shortest_decimal_bufn referenced in function halfvec_out
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Fix pgvector Installation Issue on PostgreSQL 17 RC1
The error LNK2019 indicates that the linker cannot find the definition for the function 'float_to_shortest_decimal_bufn'. This function may have been introduced or modified in PostgreSQL 17, and the pgvector extension code is not compatible with these changes, leading to unresolved external symbols during the nmake process.
Awaiting Verification
Be the first to verify this fix
- 1
Update pgvector Codebase
Check the pgvector repository for any updates or patches that address compatibility with PostgreSQL 17. If available, pull the latest changes to ensure compatibility with the new version.
bashgit pull origin main - 2
Modify pgvector Source Code
If no updates are available, you may need to modify the pgvector source code to replace or redefine the usage of 'float_to_shortest_decimal_bufn' with the appropriate function or logic that is compatible with PostgreSQL 17.
c// Example modification in pgvector.c #include "utils/float.h" // Ensure correct header is included // Replace usage of float_to_shortest_decimal_bufn with an alternative - 3
Rebuild pgvector Extension
After making the necessary changes, rebuild the pgvector extension using nmake to ensure that all modifications are compiled correctly.
bashnmake - 4
Test Installation
Once the build is successful, attempt to install the pgvector extension in PostgreSQL 17 to verify that the issue has been resolved.
bashpsql -d your_database -c 'CREATE EXTENSION pgvector;'
Validation
Confirm that the pgvector extension is successfully installed by running the command 'SELECT * FROM pg_extension;' in your PostgreSQL database. Ensure that pgvector appears in the list without errors.
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep