What is the format for the PostgreSQL connection string / URL?

Viewed 620798

What is the format for the PostgreSQL connection string (URL postgres://...) when the host is not the localhost?

6 Answers

The following worked for me

const conString = "postgres://YourUserName:YourPassword@YourHostname:5432/YourDatabaseName";
DATABASE_URL=postgres://{user}:{password}@{hostname}:{port}/{database-name}
server.address=10.20.20.10
server.port=8080
database.user=username
database.password=password
spring.datasource.url=jdbc:postgresql://${server.address}/${server.port}?user=${database.user}&password=${database.password}
Related