-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection.reset fails on Amazon Redshift #29
Comments
Sure, if you use separate connections (which you are), it is possible to run an arbitrary number of queries concurrently. That's basically the main feature of asyncpg :-). Now, whether or not the queries actually execute concurrently depends on the locking that your queries cause. For example, if you run
Cheers! |
Thanks a lot @elprans for you response. import asyncio
import asyncpg
async def connect_to_db():
pool = await asyncpg.create_pool("postgres://user:pass@localhost:5555/dev",
command_timeout=60)
conn1 = await pool.acquire()
try:
a = await conn1.fetch("""SELECT 1;""")
print(a)
finally:
await pool.release(conn1)
loop = asyncio.get_event_loop()
loop.run_until_complete(connect_to_db()) Here is the stacktrace :
Looking at the source code the error https://github.com/MagicStack/asyncpg/blob/master/asyncpg/exceptions/__init__.py#L554 I don't understand the relation with a postgres syntax error. (I'm connecting to a redshift cluster) |
This is triggered by It is likely that Redshift's version of postgres doesn't support either |
Calling |
Ouch! That's ancient! That version was released over 10 years ago. |
OK, we'll need to find a way to close the cursors on that version. Meanwhile, you can just drop the |
Are there any updates to this issue? I've tried the proposed workaround (drop the CLOSE ALL;) but it doesn't help. |
We'll probably be able to get some level of support going. I'll try to take a look soon. |
Let's say I have two long running queries that I'd like to run concurrently
Here is my questions :
Thanks for this library
The text was updated successfully, but these errors were encountered: