pg_connect
PG_CONNECT() PostgreSQL 7.4.19 Documentation PG_CONNECT()
NAME
pg_connect - open a connection to the server
SYNOPSIS
pg_connect -conninfo connectOptions
pg_connect dbName [-host hostName] [-port portNumber] [-tty tty] [-options serverOptions]
DESCRIPTION
pg_connect opens a connection to the PostgreSQL server.
Two syntaxes are available. In the older one, each possible option has
a separate option switch in the pg_connect command. In the newer form,
a single option string is supplied that can contain multiple option
values. pg_conndefaults can be used to retrieve information about the
available options in the newer syntax.
ARGUMENTS
"NEW STYLE"
connectOptions
A string of connection options, each written in the form key-
word = value. A list of valid options can be found in the
description of the libpq function PQconnectdb.
"OLD STYLE"
dbName The name of the database to connect to.
-host hostName
The host name of the database server to connect to.
-port portNumber
The TCP port number of the database server to connect to.
-tty tty
A file or TTY for optional debug output from the server.
-options serverOptions
Additional configuration options to pass to the server.
RETURN VALUE
If successful, a handle for a database connection is returned. Han-
dles start with the prefix pgsql.
2008-01-03 PG_CONNECT()