You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In v5.7.1, when scanning into types that implemented both sql.Scanner and json.Unmarshaler, UnmarshalJSON was preferred. Since v5.7.2, Scan is preferred.
In pgx the sql.Scanner interface is preferred over other possibilities. JSON(B) was the exception under certain circumstances (see #2146 and #2151). This was changed in 5.7.2, but forgotten in the patch notes by @jackc. Thus, this change in behaviour is a bug fix.
I would leave this open until the patch notes are updated.
Describe the bug
In v5.7.1, when scanning into types that implemented both sql.Scanner and json.Unmarshaler, UnmarshalJSON was preferred. Since v5.7.2, Scan is preferred.
To Reproduce
Something like this shows the difference:
Passes on v5.7.1, but errors on v5.7.2 and master as of right now.
Expected behavior
UnmarshalJSON is invoked.
Actual behavior
Scan is invoked with a
string
argument instead.Version
Additional Context
This isn't hard to fix/workaround, but it is a change in behavior in a patch release.
The text was updated successfully, but these errors were encountered: