From 092133beb349964543f37805340ef303d2ffe28c Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 28 Apr 2003 04:29:12 +0000 Subject: Okay, I've had it with PQsetdbLogin having slightly different defaults than PQconnectdb. Reimplement the former to use the same code as the latter. Fix documentation omissions while at it. --- doc/src/sgml/libpq.sgml | 93 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 73 insertions(+), 20 deletions(-) (limited to 'doc/src/sgml') diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 5ba7e6468c3..b8499f02323 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -1,5 +1,5 @@ @@ -114,21 +114,26 @@ PGconn *PQconnectdb(const char *conninfo); used. - Using hostaddr instead of host allows the application to avoid a host - name look-up, which may be important in applications with time - constraints. However, Kerberos authentication requires the host - name. The following therefore applies: If host is specified without - hostaddr, a host name lookup is forced. If hostaddr is specified without - host, the value for hostaddr gives the remote address; if Kerberos is - used, this causes a reverse name query. If both host and hostaddr are - specified, the value for hostaddr gives the remote address; the value - for host is ignored, unless Kerberos is used, in which case that value - is used for Kerberos authentication. Note that authentication is likely - to fail if libpq is passed a host name that is not the name of the - machine at hostaddr. + Using hostaddr instead of host allows the + application to avoid a host name look-up, which may be important in + applications with time constraints. However, Kerberos authentication + requires the host name. The following therefore applies: If + host is specified without hostaddr, a host name + lookup is forced. If hostaddr is specified without + host, the value for hostaddr gives the remote + address; if Kerberos is used, this causes a reverse name query. If both + host and hostaddr are specified, the value for + hostaddr gives the remote address; the value for + host is ignored, unless Kerberos is used, in which case that + value is used for Kerberos authentication. (Note that authentication is + likely to fail if libpq is passed a host name + that is not the name of the machine at hostaddr.) Also, + host rather than hostaddr is used to identify + the connection in $HOME/.pgpass. - Without either a host name or host address, libpq will connect using a + Without either a host name or host address, + libpq will connect using a local Unix domain socket. @@ -176,7 +181,8 @@ PGconn *PQconnectdb(const char *conninfo); Maximum wait for connection, in seconds (write as a decimal integer - string). Zero or not specified means infinite. + string). Zero or not specified means wait indefinitely. It is not + recommended to set the timeout to less than 2 seconds. @@ -2321,7 +2327,7 @@ information into simple client applications, for example. PGHOST -PGHOST sets the default server name. +PGHOST sets the database server name. If this begins with a slash, it specifies Unix-domain communication rather than TCP/IP communication; the value is the name of the directory in which the socket file is stored (default /tmp). @@ -2329,10 +2335,22 @@ directory in which the socket file is stored (default /tmp) + + PGHOSTADDR + +PGHOSTADDR specifies the numeric IP address of the database +server. This can be set instead of PGHOST to avoid DNS +lookup overhead. See the documentation of +these parameters, under PQconnectdb above, for details +on their interaction. + + + + PGPORT -PGPORT sets the default TCP port number or Unix-domain +PGPORT sets the TCP port number or Unix-domain socket file extension for communicating with the PostgreSQL server. @@ -2342,7 +2360,7 @@ socket file extension for communicating with the PGDATABASE -PGDATABASE sets the default +PGDATABASE sets the PostgreSQL database name. @@ -2369,6 +2387,19 @@ file (see ). + + PGSERVICE + +PGSERVICE +sets the service name to be looked up in pg_service.conf. +This offers a shorthand way of setting all the parameters. + + + + + + PGREALM + PGREALM sets the Kerberos realm to use with PostgreSQL, if it is different from the local realm. If PGREALM is set, libpq @@ -2380,12 +2411,18 @@ used if Kerberos authentication is selected by the server. + + PGOPTIONS + PGOPTIONS sets additional run-time options for the PostgreSQL server. + + PGREQUIRESSL + PGREQUIRESSL sets whether or not the connection must be made over SSL. If set to 1, libpq @@ -2397,10 +2434,14 @@ This option is only available if + + PGCONNECT_TIMEOUT + PGCONNECT_TIMEOUT sets the maximum number of seconds that libpq will wait when attempting to -connect to the PostgreSQL server. This -option should be set to at least 2 seconds. +connect to the PostgreSQL server. If unset +or set to zero, libpq will wait indefinitely. +It is not recommended to set the timeout to less than 2 seconds. @@ -2413,6 +2454,9 @@ behavior for every PostgreSQL session. + + PGDATESTYLE + PGDATESTYLE sets the default style of date/time representation. (Equivalent to SET datestyle TO ....) @@ -2420,6 +2464,9 @@ sets the default style of date/time representation. + + PGTZ + PGTZ sets the default time zone. (Equivalent to SET timezone TO ....) @@ -2427,6 +2474,9 @@ sets the default time zone. + + PGCLIENTENCODING + PGCLIENTENCODING sets the default client character set encoding. (Equivalent to SET client_encoding TO ....) @@ -2434,6 +2484,9 @@ sets the default client character set encoding. + + PGGEQO + PGGEQO sets the default mode for the genetic query optimizer. (Equivalent to SET geqo TO ....) -- cgit v1.2.3