Postgres连接url

Postgres连接url如何形成,当主机是一些其他计算机比本地主机?

我已经允许Postgres接受来自外部的请求。

如果你使用Libpq绑定相应的语言,根据它的文档 URI形成如下:

postgresql://[user[:password]@][netloc][:port][/dbname][?param1=value1&...] 

以下是来自同一文件的示例

 postgresql:// postgresql://localhost postgresql://localhost:5433 postgresql://localhost/mydb postgresql://user@localhost postgresql://user:secret@localhost postgresql://other@localhost/otherdb?connect_timeout=10&application_name=myapp postgresql://localhost/mydb?user=other&password=secret 

这里是JDBC的文档,一般的URL是“jdbc:postgresql:// host:port / database”

这里第3章介绍了ADO.NET连接string,一般连接string是Server=host;Port=5432;User Id=username;Password=secret;Database=databasename;

我们在这里把PHP文档中,一般连接string是host=hostname port=5432 dbname=databasename user=username password=secret

如果你使用别的东西,你必须告诉我们。

主机或主机名将是远程服务器的IP地址,或者如果您可以通过计算机名称通过networking访问它,则应该起作用。

postgres语法的连接url:

 "Server=host ipaddress;Port=5432;Database=dbname;User Id=userid;Password=password; 

例:

 "Server=192.168.1.163;Port=5432;Database=postgres;User Id=postgres;Password=root;