PostgreSQL连接URL [英] PostgreSQL Connection URL
本文介绍了PostgreSQL连接URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当主机是本地主机以外的其他计算机时,PostgreSQL连接URL是如何形成的?
How is the PostgreSQL connection URL formed, when the host is some other computer than the localhost?
我已允许PostgreSQL接受来自外部的请求。
I have allowed PostgreSQL to accept requests from outside.
推荐答案
如果您对各自的语言使用Libpq绑定,请根据其文档 URI的格式如下:
If you use Libpq binding for respective language, according to its documentation URI is formed as follows:
postgresql://[user[:password]@][netloc][:port][/dbname][?param1=value1&...]
以下是同一文档中的示例
Here are examples from same document
postgresql://
postgresql://localhost
postgresql://localhost:5432
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
这篇关于PostgreSQL连接URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文