3 months ago
I have an issue, when I create a db using the pgvector extension, I don't see a database tab like I would see in a regular database template.
I am tryting to create a database that has pgvector extension
Attachments
Pinned Solution
3 months ago
no problem, let's try get you connected
for pgAdmin get your connection details from Railway's service variables:
host: Your service's public domain or
RAILWAY_PRIVATE_DOMAINport: 5432
database: postgres
username: postgres
pswd: Check your
POSTGRES_PASSWORDvariable (you might need to set this if you haven't)
and in pgAdmin, create a new server and plug in those details make sure you're using the public domain if connecting from outside railway
for vscode : use the postgresql extension and your connection string should look like:
postgresql://postgres:YOUR_PASSWORD@YOUR_HOST:5432/postgresmake sure your service has a public domain exposed (check railway settings), and double-check your password is set in the environment variables , If it's timing out, the port might not be exposed publicly
if this didn't work for you, can you share what error message you're getting when trying to connect
10 Replies
3 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!
3 months ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open brody • 3 months ago
3 months ago
So can you explain why I can't see the database tab when I create a template that has the postgresql and pgvector18 template? I looked at the BOT and I can't seem to find an answer to my issue
3 months ago
3 months ago
Hey! the pgvector templates work fine, they just don't show Railway's database UI tab because they're Docker containers, not managed databases.
to fix this just use the pgvector-pg18 template you deployed. Connect to it with the connection details from your service variables, then run this sql:
CREATE EXTENSION IF NOT EXISTS vector;
The database works exactly the same - you just manage it through regular PostgreSQL tools (psql, pgAdmin, etc.) instead of Railway's UI. That's normal for these templates.
don't switch your existing postgres-ssl:17 image to a pgvector image, you'll lose all your data. If you need pgvector on that existing database, connect to it first and try running CREATE EXTENSION vector; to see if it's already available. If not, you'll need to start fresh with a pgvector template.
bytekeim
Hey! the pgvector templates work fine, they just don't show Railway's database UI tab because they're Docker containers, not managed databases.to fix this just use the pgvector-pg18 template you deployed. Connect to it with the connection details from your service variables, then run this sql:CREATE EXTENSION IF NOT EXISTS vector;The database works exactly the same - you just manage it through regular PostgreSQL tools (psql, pgAdmin, etc.) instead of Railway's UI. That's normal for these templates.don't switch your existing postgres-ssl:17 image to a pgvector image, you'll lose all your data. If you need pgvector on that existing database, connect to it first and try running CREATE EXTENSION vector; to see if it's already available. If not, you'll need to start fresh with a pgvector template.
3 months ago
Thank you for the information. I created a PostgreSQL db using the pgvector-pg18 template, but now I am having issues connecting to pgAdmin or even using VSCode.
bytekeim
Hey! the pgvector templates work fine, they just don't show Railway's database UI tab because they're Docker containers, not managed databases.to fix this just use the pgvector-pg18 template you deployed. Connect to it with the connection details from your service variables, then run this sql:CREATE EXTENSION IF NOT EXISTS vector;The database works exactly the same - you just manage it through regular PostgreSQL tools (psql, pgAdmin, etc.) instead of Railway's UI. That's normal for these templates.don't switch your existing postgres-ssl:17 image to a pgvector image, you'll lose all your data. If you need pgvector on that existing database, connect to it first and try running CREATE EXTENSION vector; to see if it's already available. If not, you'll need to start fresh with a pgvector template.
3 months ago
Small correction: We don't offer managed databases at all, everything is a container.
brody
Small correction: We don't offer managed databases at all, everything is a container.
3 months ago
thanks for the clarification! yeah, everything's containerized on railway, my bad on the wording :))
uzochiapa
Thank you for the information. I created a PostgreSQL db using the pgvector-pg18 template, but now I am having issues connecting to pgAdmin or even using VSCode.
3 months ago
no problem, let's try get you connected
for pgAdmin get your connection details from Railway's service variables:
host: Your service's public domain or
RAILWAY_PRIVATE_DOMAINport: 5432
database: postgres
username: postgres
pswd: Check your
POSTGRES_PASSWORDvariable (you might need to set this if you haven't)
and in pgAdmin, create a new server and plug in those details make sure you're using the public domain if connecting from outside railway
for vscode : use the postgresql extension and your connection string should look like:
postgresql://postgres:YOUR_PASSWORD@YOUR_HOST:5432/postgresmake sure your service has a public domain exposed (check railway settings), and double-check your password is set in the environment variables , If it's timing out, the port might not be exposed publicly
if this didn't work for you, can you share what error message you're getting when trying to connect
3 months ago
Thank you bytekeim. The only change I made was the port. I used a different port that was in the public networking tab. 5432 wasn't working at first. After the connection was established, I was able to create an extension vector using this command
CREATE EXTENSION IF NOT EXISTS vector; CREATE TABLE items (id serial PRIMARY KEY, embedding vector(1536));
3 months ago
awesome! glad you got it working; you're all set to start storing embeddings now :))
Status changed to Solved uxuz • 3 months ago
