Replies: 2 comments 3 replies
-
|
My guess is you have implemented Also, I suspect that the composite type isn't really a factor. You could reduce the problem area by seeing if the same thing happens when trying to use it as a smallint argument directly. |
Beta Was this translation helpful? Give feedback.
-
|
Writing here in case this helps others who are impacted, commit 08c9bb1f0d8fa6cc10ed8c713e68b1baa64dfe2c broke our code when updating pgx to We started encountering the following errors: We had places in our codebase that implicitly relied on the String() conversion that pgx was doing. e.g. s.db.ExecContext(
ctx,
insertQuery,
id,
// NotificationType is a proto enum
in.NotificationType
)The solution was to explicitly convert to String outside of pgx: s.db.ExecContext(
ctx,
insertQuery,
id,
in.NotificationType.String()
) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have an enum, e.g.
it's generated from a .proto using bufbuild
i want to use it inside a custom postgres type array on a table:
and types are loaded a registered after connecting:
now, when inserting a record, i get:
ERROR: invalid input syntax for type smallint: "RECORD_TYPE_CEILING" (SQLSTATE 22P02)
yet when I insert this type directly in a smallint DB column, i get the correct 200 integer value.
Is there a reason for the difference in behaviour here and is there any way to tell pgx to use the integer value for the enum inside this custom type?
Beta Was this translation helpful? Give feedback.
All reactions