Skip to content
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

Make array field adapter independent from the connection. #721

Closed
wants to merge 1 commit into from
Closed

Make array field adapter independent from the connection. #721

wants to merge 1 commit into from

Conversation

stas
Copy link

@stas stas commented Sep 24, 2015

Since the field does not depend on the database OIDs, calling prepare() is not necessary. This is also mentioned in the docs1. The reason this is not dependent on the connection since we don't try to adapt any special OIDs that can vary from one Postgres version to another.

We discovered this when a wrapped connection was used to adapt the new type.
Relevant: opbeat/opbeat_python#68

Thanks in advance for reviewing this.

Since the field does not depend on the database OIDs, calling `prepare()`
is not necessary. This is also mentioned in the docs.
@stas
Copy link
Author

stas commented Sep 24, 2015

Hmm, it looks like there's something strange with the way py3 handles the unicode string adapter.

This could be related to psycopg/psycopg2#331
I've tried a couple of things, including calling adapted.prepare(conn) and explicitly setting the connection encoding to UTF8, still on py3 I get the adapter result as bytea.

We can close this until the py3 support is not ready... :|

@stas stas closed this Sep 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant