Replies: 2 comments
-
I'm guessing you are doing something like this: select time_range @> $1 from reservations pgx uses the extended protocol which parses the statement before binding the values. PostgreSQL returns the expected types of the bind variables. It knows the type of Try this instead to let it know the expected type: select time_range @> $1::timestamptz from reservations |
Beta Was this translation helpful? Give feedback.
0 replies
-
Yes, that works. Good! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
(Ref https://www.postgresql.org/docs/15/functions-range.html)
The @> operator can take two forms:
or
I am currently working with tstzrange, and things are working fine for the first case,
tstzrange @> tstzrange
.But when trying the second form,
tstzrange @> timestamptz
(meaning "is the timestamp inside the time range") I get the errorIt seems to expect both sides of the operator to be same type?
Beta Was this translation helpful? Give feedback.
All reactions