PostgreSQL连接字符串(URLpostgres://...)当主机不是本地主机时
如果您对各自的语言使用Libpq绑定,则根据其文档,URI的格式如下:
postgresql://[user[:password]@][netloc][:port][/dbname][?param1=value1&;]
下面是来自同一文档的示例
postgresql://
Postgresql://localhost
Postgresql://localhost:5432
Postgresql://localhost/mydb
Postgresql://[email protected]本地主机
Postgresql://user:[email protected]本地主机
Postgresql://[email protected]/otherdb?连接超时=10&;应用程序名称=myapp
Postgresql://localhost/mydb?user=other&密码=秘密