<term><function>PQsetdbLogin</function><indexterm><primary>PQsetdbLogin</primary></indexterm></term>
<listitem>
<para>
Makes a new connection to the database server.
<synopsis>
PGconn *PQsetdbLogin(const char *pghost,
const char *pgport,
const char *pgoptions,
const char *pgtty,
const char *dbName,
const char *login,
const char *pwd);
</synopsis>
</para>
<para>
This is the predecessor of <xref linkend="libpq-PQconnectdb"/> 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 or has a valid connection <acronym>URI</acronym> prefix, it
is taken as a <parameter>conninfo</parameter> string in exactly the same way as
if it had been passed to <xref linkend="libpq-PQconnectdb"/>, and the remaining
parameters are then applied as specified for <xref linkend="libpq-PQconnectdbParams"/>.
</para>
<para>
<literal>pgtty</literal> is no longer used and any value passed will
be ignored.
</para>
</listitem>
</varlistentry>
<varlistentry id="libpq-PQsetdb">
<term><function>PQsetdb</function><indexterm><primary>PQsetdb</primary></indexterm></term>
<listitem>
<para>
Makes a new connection to the database server.
<synopsis>
PGconn *PQsetdb(char *pghost,
char *pgport,
char *pgoptions,
char *pgtty,
char *dbName);
</synopsis>
</para>
<para>
This is a macro that calls <xref linkend="libpq-PQsetdbLogin"/> with null pointers
for the <parameter>login</parameter> and <parameter>pwd</parameter> parameters. It is provided
for backward compatibility with very old programs.
</para>
</listitem>
</varlistentry>
<varlistentry id="libpq-PQconnectStartParams">
<term><function>PQconnectStartParams</function><indexterm><primary>PQconnectStartParams</primary></indexterm></term>
<term><function>PQconnectStart</function><indexterm><primary>PQconnectStart</primary></indexterm></term>
<term id="libpq-PQconnectPoll"><function>PQconnectPoll</function><indexterm><primary>PQconnectPoll</primary></indexterm></term>
<listitem>
<para>
<indexterm><primary>nonblocking connection</primary></indexterm>
Make a connection to the database server in a nonblocking manner.
<synopsis>
PGconn *PQconnectStartParams(const char * const *keywords,
const char * const *values,
int expand_dbname);
PGconn *PQconnectStart(const char *conninfo);
PostgresPollingStatusType PQconnectPoll(PGconn *conn);
</synopsis>
</para>
<para>
These three functions are used to open a connection to a database server such
that your application's thread of execution is not blocked on remote I/O
whilst doing so. The point of this approach is that the waits for I/O to
complete can occur in the application's main loop, rather than down inside
<xref linkend="libpq-PQconnectdbParams"/> or <xref linkend="libpq-PQconnectdb"/>, and so the
application can manage this operation in parallel with other activities.
</para>
<para>
With <xref linkend="libpq-PQconnectStartParams"/>, the database connection is made
using the parameters taken from the <literal>keywords</literal> and
<literal>values</literal> arrays, and controlled by <literal>expand_dbname</literal>,
as described above for <xref linkend="libpq-PQconnectdbParams"/>.
</para>
<para>