R
Railwayβ€’12mo ago
Rozukai

Error while connecting to database through private network

Hi everyone, I just migrate my postgres database and thus change some environment variable. I've set my database url to "postgres.railway.internal" as host but I got this error when running my app :
failed creating schema resources: querying server version dial tcp: lookup postgres.railway.internal on 8.8.8.8:53: no such host
failed creating schema resources: querying server version dial tcp: lookup postgres.railway.internal on 8.8.8.8:53: no such host
Do you know why ? Have a good say πŸ˜‰
8 Replies
Percy
Percyβ€’12mo ago
Project ID: 62a7d631-15d2-4bde-a633-b2e28b306105
Rozukai
RozukaiOPβ€’12mo ago
62a7d631-15d2-4bde-a633-b2e28b306105
Brody
Brodyβ€’12mo ago
try adding a sleep 3 to the beginning of your current start command! sleep 3 && <whatever your current start command is>
Rozukai
RozukaiOPβ€’12mo ago
It worked by waiting ^^ I got this error btw : pq: permission denied for schema public When I create my users and database I do that :
CREATE DATABASE example_database;
CREATE USER example_database_user WITH PASSWORD 'secure_password';
GRANT ALL PRIVILEGES ON DATABASE example_database TO example_database_user;
CREATE DATABASE example_database;
CREATE USER example_database_user WITH PASSWORD 'secure_password';
GRANT ALL PRIVILEGES ON DATABASE example_database TO example_database_user;
It worked well before the migration I will dig to see if I find something
Brody
Brodyβ€’12mo ago
where are you running those commands
Rozukai
RozukaiOPβ€’12mo ago
On heidiSQL with the POSTGRES_USER It's a pgAdmin like
Brody
Brodyβ€’12mo ago
well the new database is postgres 15
Rozukai
RozukaiOPβ€’12mo ago
I found a solution, I've created the database with the corresponding user πŸ˜‰ You can close this thread
Want results from more Discord servers?
Add your server