diff options
author | Andrew Dunstan | 2006-12-19 01:53:36 +0000 |
---|---|---|
committer | Andrew Dunstan | 2006-12-19 01:53:36 +0000 |
commit | 5133dd786b0041114ba4da6b174ade8c33917e68 (patch) | |
tree | 28aebae4a92136e92ebf1b3b390d416c823a2221 /doc | |
parent | 93b4f0ff7711d42b8c10e48b0a7575e2847e30b3 (diff) |
Interpret a dbName param to PQsetdbLogin as a conninfo string if it contains an = sign. Tom Lane and Andrew Dunstan.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/src/sgml/libpq.sgml | 20 | ||||
-rw-r--r-- | doc/src/sgml/ref/psql-ref.sgml | 18 |
2 files changed, 30 insertions, 8 deletions
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 40d0bcb1fb..0fc0f76fd2 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -1,4 +1,4 @@ -<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.220 2006/11/10 22:15:26 tgl Exp $ --> +<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.221 2006/12/19 01:53:36 adunstan Exp $ --> <chapter id="libpq"> <title><application>libpq</application> - C Library</title> @@ -324,13 +324,19 @@ PGconn *PQsetdbLogin(const char *pghost, const char *login, const char *pwd); </synopsis> -</para> + </para> -<para> - This is the predecessor of <function>PQconnectdb</function> with a fixed - set of parameters. It has the same functionality except that the - missing parameters will always take on default values. Write <symbol>NULL</symbol> or an - empty string for any one of the fixed parameters that is to be defaulted. + <para> + This is the predecessor of <function>PQconnectdb</function> with a fixed + set of parameters. It has the same functionality except that the + missing parameters will always take on default values. Write <symbol>NULL</symbol> or an + empty string for any one of the fixed parameters that is to be defaulted. + </para> + <para> + If the <parameter>dbName</parameter> contains an <symbol>=</symbol> sign, it + is taken as a <parameter>conninfo</parameter> string in exactly the same way as + if it had been passed to <function>PQconnectdb</function>, and the remaining + parameters are then applied as above. </para> </listitem> </varlistentry> diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index c3071752c7..cd92a21729 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.178 2006/12/06 15:47:22 momjian Exp $ +$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.179 2006/12/19 01:53:36 adunstan Exp $ PostgreSQL documentation --> @@ -113,6 +113,10 @@ PostgreSQL documentation class="parameter">dbname</replaceable> as the first non-option argument on the command line. </para> + <para> + If this parameter contains an <symbol>=</symbol> sign, it it treated as a + <parameter>conninfo</parameter> string. See <xref linkend="libpq-connect"> for more information. + </para> </listitem> </varlistentry> @@ -555,6 +559,18 @@ PostgreSQL documentation passwords. See <xref linkend="libpq-pgpass"> for more information. </para> + <para> + An alternative way to specify connection parameters is in a + <parameter>conninfo</parameter> string, which is used instead of a + database name. This mechanism give you very wide control over the + connection. For example, +<programlisting> +$ <userinput>psql "service=myservice sslmode=require"</userinput> +</programlisting> + See <xref linkend="libpq-connect"> for more information on all the + available connection options. + </para> + <para> If the connection could not be made for any reason (e.g., insufficient privileges, server is not running on the targeted host, etc.), |