PostgreSQL has microsecond precision. If more than this precision is
supplied in the text format it is rounded. This was inconsistent with
the binary format.
See https://github.com/jackc/pgx/issues/699 for original issue.
Previously Set would always return an error when called on a range type.
Now it will accept an instance of itself, a pointer to an instance of
itself, a string, or nil. Strings are parsed with the same logic as
DecodeText.
Methods defined on T are also available on *T. Thought this technically
changes the interface, because *T will be automatically dereferenced as
needed it shouldn't be a breaking change.
See a8802b16cc593842f5c69b0f7cfb0de11d5cd3a8 for similar change.
typed_array.go.erb was not updated back in
a8802b16cc593842f5c69b0f7cfb0de11d5cd3a8 when Value, EncodeBinary,
EncodeText, and MarshalJSON were changed to be defined on T instead of
*T. This has been corrected.
Methods defined on T are also available on *T. This change makes Value
consistent with database/sql Value implementations. It also makes Value,
EncodeBinary, and EncodeText more convenient to use because you can
pass T or *T as an argument to a query.
The MarshalJSON change is even more significant because without it
json.Marshal would generate the "%v" format instead of the implemented
MarshalJSON.
Thought this technically changes the interface, because *T will be
automatically dereferenced as needed it shouldn't be a breaking change.
See: https://github.com/jackc/pgx/issues/538 for initial discussion.
It was a mistake to use it in other contexts. This made interop
difficult between pacakges that depended on pgtype such as pgx and
packages that did not like pgconn and pgproto3. In particular this was
awkward for prepared statements.
Because pgx depends on pgtype and the tests for pgtype depend on pgx
this change will require a couple back and forth commits to get the
go.mod dependecies correct.
commit 251e6b7730c7b31b600e6fe06162e541f3032604
Author: Nicholas Wilson <nicholas.wilson@realvnc.com>
Date: Wed Jul 24 12:32:43 2019 +0100
Tidying: make underlyingTimeType consistent with other underlyingFooType
The first return value is ignored when returning false - so there's no
point returning an empty time.Time when it can be nil.
commit fc020c24ac9590f6547f8ad1d291fc75b4873a84
Author: Nicholas Wilson <nicholas.wilson@realvnc.com>
Date: Wed Jul 24 12:32:18 2019 +0100
Add support for pgtype.UUID to write into any [16]byte type