Disabling prepared statements in gino #800
-
Hi all At the moment I'm trying to start using RDS proxy (which is basically a managed pgBouncer solution from aws) and I'm getting session-pinning due to prepared statements. We don't use prepared statements ourselves, and I've already followed asyncpg instructions for working with pgBouncer and specified RDS proxy logs indicating session pinning due to a prepared statement
Question:
🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
@ilanKeshet, please check this test case. I have not tried this method, but I think it might be helpful. |
Beta Was this translation helpful? Give feedback.
-
can you try to disable bakery? https://github.com/python-gino/gino/blob/master/docs/how-to/bakery.rst#i-dont-want-the-prepared-statements |
Beta Was this translation helpful? Give feedback.
-
Depends on how you define "prepared statements" - in Postgres protocol, there are two ways to execute a query, the Simple Query and the Extended Query. While the Simple Query is done with a single request message, the extended query is done with multiple messages including GINO is not using the AWS here is complaining about receiving a
It's not possible for GINO not to send the More about Postgres protocols: https://segmentfault.com/a/1190000017136059 |
Beta Was this translation helpful? Give feedback.
Depends on how you define "prepared statements" - in Postgres protocol, there are two ways to execute a query, the Simple Query and the Extended Query. While the Simple Query is done with a single request message, the extended query is done with multiple messages including
Parse
,Bind
, andExecute
. Specically, theParse
message could contain an optional name. If the name is specified, it is equivalent to the "PREPARE" SQL, or else it's similar to Simple Query (but you still get an "anonymous" prepared statement).asyncpg
always uses the Extended Query, and automatically assign names to prepared statements on regular queries (n…