-
-
Notifications
You must be signed in to change notification settings - Fork 208
Closed
Description
Python 3.9
Psycopg 3.0.8
Unable to catch psycopg.OperationalError
import asyncio
import psycopg
async def main():
async with await psycopg.AsyncConnection.connect(conninfo='postgresql://xxxxxxxxxxxxxx') as con:
async with con.cursor() as cur:
try:
async for r in cur.stream('select 1 a'):
raise NameError('Error here!')
except:
pass
if __name__ == '__main__':
asyncio.run(main())and we get the error
File "psycopg_binary\\pq/pgconn.pyx", line 223, in psycopg_binary.pq.PGconn.send_query
psycopg.OperationalError: sending query failed: another command is already in progressMetadata
Metadata
Assignees
Labels
No labels