2.3 Forming a Connection String

Table of Contents Previous Next


2 Open Client Library : 2.3 Forming a Connection String

[//][host][:port][/dbname]
postgres://[user[:password]@][host][:port][/dbname]
[?
param1=value1&...]
postgresql://[user[:password]@][host][:port][/dbname]
[?
param1=value1&...]
user is the name of the connecting user.
password is the password associated with the connecting user.
host is the host name or IP address to which you are connecting; to specify an IPV6 address, enclose the address in square brackets.
port is the port number to which you are connecting.
dbname is the name of the database with which you are connecting.
paramx=valuex pairs specify extra (application-specific) connection properties.
For example, each of the following connection strings establish a connection to the edb database on port 5444 of a system with an IP address of 10.0.0.4:

2 Open Client Library : 2.3 Forming a Connection String

Table of Contents Previous Next