#29965: Postgresql hstore extension not initialized in testing
-------------------------------------+-------------------------------------
               Reporter:  winged     |          Owner:  nobody
                   Type:             |         Status:  new
  Uncategorized                      |
              Component:             |        Version:  2.1
  Uncategorized                      |
               Severity:  Normal     |       Keywords:  hstore, postgresql
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 I'm using pytest-django, so I'm not 100% sure this belongs here or with
 pytest-django itself, but nonetheless:

 In one of my projects, I'm using HStore fields from the
 django.contrib.postgres package. The HStore extension needs to be
 registered with psycopg2 on a per-connection basis.
 changeset:f7b0532ec0cf703849ef (as a followup to changeset:86a18dc46a)
 skips registering on "unknown" databases, which then leads to the
 extension missing when running tests.

 It seems that the extension is properly registered when creating the DB
 for each test run, but not when reusing it.

 The current workaround is a custom signal handler on `connection_created`
 to call `psycopg2.exttras.register_hstore()` explicitly (without OID
 parameters, so it forces auto-detection).

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29965>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.55fbf8719276275fd641b945e6d45f0a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to