0

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:

enter image description here

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.

asked Nov 21, 2024 at 17:42
6
  • $libdir is determined at build time (of the server), presumably it's $PGROOT/lib. Commented Nov 21, 2024 at 20:42
  • PGROOT is typically an environment variable? Pretend you are talking to a 100 year old man. Commented Nov 21, 2024 at 20:53
  • PGROOT is something you set before you run nmake, 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. Commented Nov 21, 2024 at 21:01
  • I mean, where would I go to verify what I set it to? I know I set it in the screenshot, but let's say I wanted to just verify. Is there a command to do this? Commented Nov 21, 2024 at 21:03
  • There's no command to verify it; it's in effect only during the build, telling 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. Commented Nov 21, 2024 at 21:14

1 Answer 1

2

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.

answered Mar 29 at 6:29

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.