Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Return unicode arrays instead of utf-8 encoded string arrays from the psycopg database backend #189

wants to merge 1 commit into from

3 participants


When retrieving an array from the database using the psycopg2 backend, I was surprised when the query returned a utf-8 encoded string instead of a unicode string. Since django uses unicode everywhere internally, it should enable the psycopg connection setting that automatically converts database arrays into python unicode arrays.


An added tests would be good, this would allow me to see what actually changes in behavior. The right place is in tests/regressiontests/backends/ A small sample project (or just few lines of code) showing the issue is acceptable, too.

@Suor Suor referenced this pull request in Suor/handy

model StringArrayField #8


No changes sine 6 months and no ticket, so closing here.

@apollo13 apollo13 closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 7, 2012
  1. @hogbait
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 0 deletions.
  1. +1 −0  django/db/backends/postgresql_psycopg2/
1  django/db/backends/postgresql_psycopg2/
@@ -28,6 +28,7 @@
IntegrityError = Database.IntegrityError
psycopg2.extensions.register_adapter(SafeString, psycopg2.extensions.QuotedString)
psycopg2.extensions.register_adapter(SafeUnicode, psycopg2.extensions.QuotedString)
Something went wrong with that request. Please try again.