Introduce two new libpq connection functions, PQconnectdbParams and
authorJoe Conway <mail@joeconway.com>
Thu, 28 Jan 2010 06:28:26 +0000 (06:28 +0000)
committerJoe Conway <mail@joeconway.com>
Thu, 28 Jan 2010 06:28:26 +0000 (06:28 +0000)
commite3f36838e5b2666a15286b137bb11f35a7245848
treebcdcad4eabf09755a2835985265332900c2cecb4
parent83cb7da7dcd11f658a7fc4aff198923bf76ff8f5
Introduce two new libpq connection functions, PQconnectdbParams and
PQconnectStartParams. These are analogous to PQconnectdb and PQconnectStart
respectively. They differ from the legacy functions in that they accept
two NULL-terminated arrays, keywords and values, rather than conninfo
strings. This avoids the need to build the conninfo string in cases
where it might be inconvenient to do so. Includes documentation.

Also modify psql to utilize PQconnectdbParams rather than PQsetdbLogin.
This allows the new config parameter application_name to be set, which
in turn is displayed in the pg_stat_activity view and included in CSV
log entries. This will also ensure both new functions get regularly
exercised.

Patch by Guillaume Lelarge with review and minor adjustments by
Joe Conway.
doc/src/sgml/libpq.sgml
src/bin/psql/startup.c
src/interfaces/libpq/exports.txt
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/libpq-fe.h