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
This is necessary when using PgBouncer because otherwise the default simplistically-generated statement names can fight with other programs using asyncpg due to PgBouncer sharing the same underlying PostgreSQL connection and thus the prepared statement names. [Supposedly asyncpg can be made to use an unnamed statement here by turning the cache off][0], but I can't for the life of me figure out how to do that when using asyncpg through SQLAlchemy; I observe that setting `prepared_statement_cache_size` to `0` as described [here][1] doesn't cause `use_cache` to be `False`. Anyway, that's not really asyncpg's problem. I think this functionality should probably be provided either way since it'd be kinda weird to only allow configuring the names of *some* prepared statements. [0]: https://github.com/MagicStack/asyncpg/blob/1aab2094d82104d5eee2cffcfd0c7e7347d4c5b8/asyncpg/connection.py#L415-L424 [1]: https://docs.sqlalchemy.org/en/20/dialects/postgresql.html#prepared-statement-cache
0 commit comments