Installing pgvector on Window

08-09-2025

Insatalling pgvector:

set "PGROOT=C:\Users\lmiloszewski\dev_programs\postgres\17.6-1\pgsql"
cd %TEMP%
git clone --branch v0.8.1 [https://github.com/pgvector/pgvector.git](https://github.com/pgvector/pgvector.git)
cd pgvector
nmake /F Makefile.win
nmake /F Makefile.win install

Validate installation:

  • validate installation by looking at postgres installation lib directory (for vector.dll) and share directory (for extensions on vector.*)
C:\Users\LMILOS~1\AppData\Local\Temp\1\pgvector>^Lnmake /F Makefile.win
 
Microsoft (R) Program Maintenance Utility Version 14.40.33813.0
Copyright (C) Microsoft Corporation.  All rights reserved.
 
...
 
   Creating library vector.lib and object vector.exp
        copy sql\vector.sql sql\vector--0.8.1.sql
        1 file(s) copied.
 
C:\Users\LMILOS~1\AppData\Local\Temp\1\pgvector>nmake /F Makefile.win install
 
Microsoft (R) Program Maintenance Utility Version 14.40.33813.0
Copyright (C) Microsoft Corporation.  All rights reserved.
 
        copy vector.dll "C:\Users\lmiloszewski\dev_programs\postgres\17.6-1\pgsql\lib"
        1 file(s) copied.
        copy vector.control "C:\Users\lmiloszewski\dev_programs\postgres\17.6-1\pgsql\share\extension"
        1 file(s) copied.
        copy sql\vector--*.sql "C:\Users\lmiloszewski\dev_programs\postgres\17.6-1\pgsql\share\extension"
       36 file(s) copied.
        mkdir "C:\Users\lmiloszewski\dev_programs\postgres\17.6-1\pgsql\include\server\extension\vector"
        for %f in (src\halfvec.h src\sparsevec.h src\vector.h) do copy %f "C:\Users\lmiloszewski\dev_programs\postgres\17.6-1\pgsql\include\server\extension\vector"
 
C:\Users\LMILOS~1\AppData\Local\Temp\1\pgvector>copy src\halfvec.h "C:\Users\lmiloszewski\dev_programs\postgres\17.6-1\pgsql\include\server\extension\vector"
        1 file(s) copied.
 
C:\Users\LMILOS~1\AppData\Local\Temp\1\pgvector>copy src\sparsevec.h "C:\Users\lmiloszewski\dev_programs\postgres\17.6-1\pgsql\include\server\extension\vector"
        1 file(s) copied.
 
C:\Users\LMILOS~1\AppData\Local\Temp\1\pgvector>copy src\vector.h "C:\Users\lmiloszewski\dev_programs\postgres\17.6-1\pgsql\include\server\extension\vector"
        1 file(s) copied.

Usage:

session.execute(text('CREATE EXTENSION IF NOT EXISTS vector'))