I am not a DBA. I am trying to test and experiment.
I am on a Windows 11 machine and using PgAdmin. I have PostgreSQL 15 installed.
When I run CREATE EXTENSION VECTOR, I get the following error message:
Could not access file "$libdir/vector": No such file or directory
How can I find out where "$libdir" is pointing to?
Edit #1:
Here is what I used to install PGVector:
https://github.com/pgvector/pgvector#windows
Edit # 2:
Based on comments below, I thought $libdir was being set by PGRoot, but when I added a vector directory to C:\Program Files\PostgreSQL15円
directory, the same error message came up.
1 Answer 1
I had a similar issue on Linux when querying my database, i was getting this error:
could not access file "$libdir/vector": No such file or directory
The problem was that vector.so
was missing from PostgreSQL’s extension directory. To check, I ran:
ls $(pg_config --pkglibdir)
Simply reinstalling the extension with:
apt install postgresql-15-pgvector
fixed the issue for me.
Explore related questions
See similar questions with these tags.
$libdir
is determined at build time (of the server), presumably it's$PGROOT/lib
.PGROOT
is something you set before you runnmake
, as shown in the screenshot in your question. Presumably you set it to something when you installed the extension. It should have pointed to your PostgreSQL installation directory.nmake
where to put the binary. The server then will use the value from it's build time to look for the library. From your recent edit it appears that you have two versions of PostgreSQL on your machine and you have installed the extension only in one of them, while trying to use it from another.