lib/pq — pull request #136 by paulsmith (2013-08-27 13:53:51+00:00)
Title: Support for hstore extension

This introduces a new type `Hstore`, which implements the interfaces necessary to encode and decode [hstore](http://www.postgresql.org/docs/9.2/static/hstore.html) values with the database/sql package. It is an alias to Go's `map[string]string`. To provide a `map[string]string` as a position parameter, it must be converted to an `Hstore`. An `Hstore` variable can be used in `Scan()` to retrieve an hstore value from a result set. It also handles a null result, simply by setting the base map to `nil`. (A method `Valid()` is provided for convenience and to mimic the `Valid` field on `NullString` et al types in database/sql).

Unlike built-in PostgreSQL types, `hstore` doesn't have a fixed oid, because it is user-installed, therefore we need to determine the oid at run-time. This is accomplished by calling `RegisterHstore` on the database connection object.