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
We are trying to use query_typed in an environment with pgcat -- we are using query_typed specifically because it avoids prepared statements, which we can't use with pgcat.
However, it seems that query_typed sometimes still uses prepared statements, if you trace the code where it calls get_type and then query::query. This is happening in a situation where we are trying to query a value that has a custom type (an enum that we've defined in postgres).
So, I think at the very least, this gotcha should probably be called out in query_typed's documentation, but I also wonder if it can be avoided by having get_type use query_typed instead of query? (I also see some code that is explicitly prepareing something in get_type too, I'm not sure if that's also about prepared statements - I have not spent a ton of time reading the code yet).
The text was updated successfully, but these errors were encountered:
We currently cache the prepared statements used for type retrieval. We could stop doing that and use query_typed - it'd probably the type lookups slightly slower but I'm assuming it would probably be unnoticeable in practice.
We are trying to use query_typed in an environment with pgcat -- we are using query_typed specifically because it avoids prepared statements, which we can't use with pgcat.
However, it seems that query_typed sometimes still uses prepared statements, if you trace the code where it calls
get_type
and thenquery::query
. This is happening in a situation where we are trying to query a value that has a custom type (an enum that we've defined in postgres).So, I think at the very least, this gotcha should probably be called out in
query_typed
's documentation, but I also wonder if it can be avoided by havingget_type
usequery_typed
instead ofquery
? (I also see some code that is explicitlyprepare
ing something in get_type too, I'm not sure if that's also about prepared statements - I have not spent a ton of time reading the code yet).The text was updated successfully, but these errors were encountered: