Closed
Description
asyncpg version: 0.22.0
Example
import asyncio
import asyncpg
async def main():
conn = await asyncpg.connect()
conn.transaction(isolation='repeatable_read', readonly=True)
asyncio.run(main())
Expected result
No error.
Actual result
"readonly" is only supported for serializable transactions
That's just not true.
START TRANSACTION ISOLATION LEVEL REPEATABLE READ READ ONLY;
The really bizarre thing is that some had to go out of their way to break this in asyncpg.
And not only that, but the check doesn't really even work that well.
A workaround is to first run SET default_transaction_isolation = 'repeatable read';
for the connection, and then avoid passing an isolation
argument to the transaction()
function.
Metadata
Metadata
Assignees
Labels
No labels