Original implementation: 2d9d8dc52ac211c6191c08e050c03588aa633038 by
Joshua Barone <joshua.barone@gmail.com>.
Also changed DSN tests to use "dbname" as key rather than "database" as
that is what the PostgreSQL documentation specifies. "database" still
actually works but it should not be encouraged as it is non-standard.
This avoids the foot-gun of ParseConfig setting AfterConnect because of
target_session_attrs and the user inadvertently overriding it with an
AfterConnect designed to setup the connection.
Now target_session_attrs will be handled with ValidateConnect.