Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When switching from v1.4.5 to v1.4.6 or above: "cannot find encode plan" on timestampz #266

Open
mlebihan opened this issue Mar 20, 2024 · 0 comments
Assignees

Comments

@mlebihan
Copy link

mlebihan commented Mar 20, 2024

Description

When upgrading from gorm.io/driver/postgres v1.4.4 or gorm.io/driver/postgres v1.4.5
to gorm.io/driver/postgres v1.4.6 or greater versions (still failling with v1.5.7)

I receive the message when I attempt to do a creation :
unable to encode util.DateTime{wall:0x7a1200, ext:63843952170, loc:(*time.Location)(nil)} into binary format for timestamptz (OID 1184): cannot find encode plan

with util.DateTime a

package util
type DateTime time.Time

The only thing I see changing from v1.4.5 to v1.4.6 is the incoming of
github.com/jackc/pgx/v5 v5.2.0 by a go mod tidy in place of the github.com/jackc/pgx/v4 that was used before.
I don't know if it's related.

Link

It seems that other users encounter the same kind of problem, with a timestamp too, with another OID 1185 instead of 1184 for me:

[Inserting Array of Time in Postgres via Gorm](https://stackoverflow.com/questions/75043520/inserting-array-of-time-in-postgres-via-gorm)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants