MeetMe/newrelic-plugin-agent — pull request #134 by mjc (2013-08-22 16:23:58+00:00)
Title: Use keyword arguments for psycopg2.connect()

Advantages:
- Keyword arguments can be constructed pretty much directly from the
YAML
- validation of parameters is left to libpq
- host, user, port, and database were unneccessarily mandatory, which
prevented the use of a unix socket to connect to postgres
- any parameters [libpq supports](http://www.postgresql.org/docs/current/static/libpq-
connect.html#LIBPQ-PARAMKEYWORDS) can be just added to the YAML.

Disadvantages:
- Currently the config structure is such that the superuser and/or name
keys need to be filtered from the config dictionary. This could be
eliminated by creating a map specifically for the connection info (see
below for sample.) I avoided doing this so as not to require a
configuration change for this pull request, but I'd be happy to
implement it.

```yaml
postgresql:
connection:
host: localhost
port: 5432
user: postgres
database: postgres
superuser: False
```
Sponsored-by: CentroNet Marketing