def initialize(dbname, user, auth, attr)
hash = Utils.parse_params(dbname)
if hash['dbname'].nil? and hash['database'].nil?
raise DBI::InterfaceError, "must specify database"
end
hash['options'] ||= ''
hash['tty'] ||= ''
hash['port'] = hash['port'].to_i unless hash['port'].nil?
@connection = PGconn.new(hash['host'], hash['port'], hash['options'], hash['tty'],
hash['dbname'] || hash['database'], user, auth)
@exec_method = :exec
@attr = attr
@attr['NonBlocking'] ||= false
@attr.each { |k,v| self[k] = v}
load_type_map
@in_transaction = false
self['AutoCommit'] = true
rescue PGError => err
raise DBI::OperationalError.new(err.message)
end