Skip to content

Unicode support for psycopg2 native hstore implementation #2

Closed
wants to merge 1 commit into from

2 participants

@dmugtasimov

This is draft pull request for unicode support for psycopg2 native hstore implementation. You would probably expect unittests for this and may be unicode support for non-native hstore support. Please, point this out and I will fix pull request.

I will also add some comments about unclear points in the source code.

@dmugtasimov dmugtasimov commented on the diff May 28, 2013
lib/sqlalchemy/dialects/postgresql/psycopg2.py
@@ -393,7 +393,8 @@ def on_connect(conn):
hstore_oids = self._hstore_oids(conn)
if hstore_oids is not None:
oid, array_oid = hstore_oids
- extras.register_hstore(conn, oid=oid, array_oid=array_oid)
+ extras.register_hstore(conn, oid=oid, array_oid=array_oid,
+ unicode=True)
@dmugtasimov
dmugtasimov added a note May 28, 2013

I am not sure if unicode=True should be hardcoded like this, probably some extra parameter should be used like use_hstore_unicode in __init__()

@zzzeek
Owner
zzzeek added a note May 28, 2013

well we have a param already called use_native_unicode, which has the effect of using psycopg2.extensions.UNICODE, and this param is generally set. Though im not quite sure we should link to hstore, does this prevent binary data from being retrieved from the hstore ? or perhaps, what's the behavior with the non-native hstore, do we return unicode in that implementation? ( I didn't write it, would have to check)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@zzzeek
Owner
zzzeek commented May 29, 2013

well its in here: 8fecf4b there's some other changes surrounding it, tests, non-psycopg2 support, etc.

thanks !

@zzzeek zzzeek closed this May 29, 2013
@dmugtasimov

Thank you! I see you have done a lot of work for it that one would probably expect from me.

@zzzeek zzzeek pushed a commit that referenced this pull request Jun 17, 2013
Mike Bayer Merged in goodscloud/sqlalchemy (pull request #2)
don't create a history entry when an object in a backref has changed
6b51923
@zzzeek zzzeek added a commit that referenced this pull request Jun 17, 2013
Mike Bayer Merged in goodscloud/sqlalchemy (pull request #2)
don't create a history entry when an object in a backref has changed
6286f71
@sqla-tester sqla-tester pushed a commit to sqla-tester/sqlalchemy that referenced this pull request Jul 23, 2014
@zzzeek - code change #2 58aa133
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.