FG
๐Ÿ’ป Software๐Ÿค– AI & LLMs

Fails to nmake on PostgreSQL 17 RC1 [Windows]

Fresh3 days ago
Mar 14, 20260 views
Confidence Score60%
60%

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

Canonical Fix
Unverified Fix
New Fix โ€“ Awaiting Verification

Fix pgvector Installation Issue on PostgreSQL 17 RC1

Medium Risk

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. 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.

    bash
    git pull origin main
  2. 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. 3

    Rebuild pgvector Extension

    After making the necessary changes, rebuild the pgvector extension using nmake to ensure that all modifications are compiled correctly.

    bash
    nmake
  4. 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.

    bash
    psql -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

AC

Alex Chen

2450 rep

Tags

pgvectorembeddingsvector-search