They now take ownership of the src argument.
Needed to change Scan to make a copy of []byte arguments as lib/pq apparently
gives Scan a shared memory buffer.
This adds PostgreSQL numeric mapping to and from
github.com/shopspring/decimal.
Makes pgtype.NullAssignTo public as external types need this functionality.
Begin extraction of pgtype testing functionality so it can easily be used by
external types.
Because reading a record type requires the decoder to be able to look up oid
to type mapping and types such as hstore have types that are not fixed between
different PostgreSQL servers it was necessary to restructure the pgtype system
so all encoders and decodes take a *ConnInfo that includes oid/name/type
information.
Set having the capability to assign an object of the same type was
inconsistently implemented. Some places it was not implemented at all, some
places it was a shallow copy, some places a deep copy. Given that it doesn't
seem likely to ever be used, and if it is needed it is easy enough to do
outside of the library this code has been removed.
To aid in composability, these methods no longer write their own length. This
is especially useful for text formatted arrays and may be useful for future
database/sql compatibility. It also makes the code a little simpler as the
types no longer have to compute their own size.
Along with this, these methods cannot encode NULL. They now return a boolean
if they are NULL. This also benefits text array encoding as numeric arrays
require NULL to be exactly `NULL` while string arrays require NULL to be
`"NULL"`.