Reputation: 3748
Hi guys so I know this question has been asked many times but the solution that have been provided doesn't seem to fix the source of my problem.
Based on what I've seen the solution is to run create extension hstore
.
However, I get the error django.db.utils.ProgrammingError: type "hstore" does not exist
when I'm trying to run a django test, ie python manage.py test test_function
I'm not familiar with django tests but from what I'm seeing with the codebase I am working with is that the django test is creating a test database when I run the django test command.
When I checkout what extensions are available with the test database with \dx
I see that it does not have hstore
. If I run create extension hstore
then the hstore extension gets created. Problem is that whenever I rerun the django test, python manage.py test test_function
it tells me the test database already exists and I need to delete it first otherwise the command exits. By deleting the database the extension that just got added also gets removed thus when I run python manage.py test test_function
again I end up with the same error.
How do I get rid of the error? Thank you.
Upvotes: 1
Views: 1401
Reputation: 3748
Turns out what I needed to do was create the hstore extension to the default template1 with:
psql template1 -c 'create extension hstore;'
Upvotes: 5