MagicStack / asyncpg

A fast PostgreSQL Database Client Library for Python/asyncio.
Apache License 2.0
6.99k stars 404 forks source link

prepared statement "asyncpg_stmt_1__" already exists error #945

Closed ghost closed 2 years ago

ghost commented 2 years ago

I have problem with prepared statement "asyncpg_stmt_1__" already exists. I created the pool with statement_cache_size=0 but somehow it works when I first ran it, then the 2nd time it will not work.

pool = await asyncpg.create_pool(<uri>, statement_cache_size=0)
async with pool.acquire() as conn:
        async with conn.transaction():
            async for record in conn.cursor("SELECT * from abc"):
                print("here")
ghost commented 2 years ago

The problem is related to prepared statement and pgbouncer, it doesn't have any problem with the lib, so I close this.