pgvector extension not available in PostgreSQL service
benson-xub
HOBBYOP

6 months ago

I want add pgvector extension in my current PostgreSQL. i tried to add pgvector extension meet this issue. Could you help me take a look.

ERROR: extension "vector" is not available
DETAIL: Could not open extension control file "/usr/share/postgresql/17/extension/vector.control": No such file or directory.
Service Details:
- Service Name: pgvector
- Service ID: pgvector-production-9978
- PostgreSQL Version: 17.7
- Status: Online
Request:
Could you please install the pgvector extension files on this PostgreSQL service? The extension should be available at:
/usr/share/postgresql/17/extension/vector.control

Thank you for your help!

Best regards,
Benson
$10 Bounty

3 Replies

Railway
BOT

6 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


enlorik
HOBBY

5 months ago

The error

ERROR: extension “vector” is not available

DETAIL: Could not open extension control file “/usr/share/postgresql/17/extension/vector.control”: No such file or directory.

means the pgvector extension is not installed on the PostgreSQL server that Railway is running for this database. On a managed Postgres service you can only enable extensions that are already present on the server; you can’t install new ones yourself, so CREATE EXTENSION vector; will always fail on this instance.

To use pgvector on Railway you need to move to a Postgres instance that has pgvector available. Typical approach:

  1. Create a new Postgres service that includes pgvector support (for example Railway’s pgvector template or a pgvector-enabled Postgres image).
  2. Migrate your data from the current database to the new one (e.g. pg_dump from the old DATABASE_URL, restore into the new DB).
  3. Point your application at the new database URL.
  4. Run: CREATE EXTENSION IF NOT EXISTS vector;

on the new database. On that pgvector-enabled instance, the command will succeed because the vector extension files are actually installed.


enlorik
HOBBY

5 months ago

If this solved it for you, you can mark it as the accepted solution so the thread is closed properly.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...