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
Support Redshift #122
Comments
I'll fix the broken f-string, thank you. Redshift is a commercial product, so I would be open to add its support if there is sponsorship for the feature. |
can be closed now i guess |
@auvipy why? |
I was able to get Redshift working by overriding I think redshift is reporting its encoding as psycopg/psycopg/psycopg/_encodings.py Line 15 in 79be4fd
|
One other note for Redshift compatibility: |
You might also see that interval should fail to be transferred to/from the database. At least in text mode, no idea about binary mode. |
@zeenewton Is there a workaround for the
during the last query. I should note that my query does not contain |
Yeah, the workaround is to just disable prepared statements when you get connection
|
This works for me:
|
An easy fix for this is to set |
works fine for me. os.environ["PGCLIENTENCODING"] = "utf-8" |
You are really refusing to add one line of code to handle this codec because AWS isn't giving you money to add that one line of code? You aren't hurting AWS. You're hurting your users. |
I keep your opinion in the utmost consideration, @7E6D4309-D2A9-4155-9D4F-287B8CDA14C1 |
We're facing this issue in pgAdmin with pgBouncer pgadmin-org/pgadmin4#6340 |
An alternative which doesn't require changing the encoding globally, is setting it on the connection string:
|
Unlike psycopg2, which is usable with Redshift out-of-the-box (in fact, the official sqlalchemy dialect for Redshift uses psycopg2 under-the-hood), psycopg3 seems to error out when calling
Cursor.execute()
against a Redshift cluster.The error I'm getting is the following (after locally fixing the broken f-string on line 91 of
psycopg._encodings
, which is where the exception is raised from):I have no idea how much work it would be to allow psycopg3 to be used against Redshift, but I can say I'd massively appreciate it.
I've currently got a use-case for running COPY commands on several hundred tables, and if I could async-ify it that would literally transform an hours-long ETL into a <10 minute length one. The idea of spawning hundreds of python interpreters to parallelize it, each with their own error reporting, is nowhere near as appealing as using asyncio-based concurrency.
The text was updated successfully, but these errors were encountered: