I'm using HstoreField in one of my models and when I try to test it I got an error psycopg2.ProgrammingError: ERROR: function hstore(integer[], text[]) does not exist
. If I understand this problem correctly it happend because hstore extension wasn't setup in database as it was did in migrations by adding HStoreExtension operation (documentation).
How to setup hstore extension in default test database and solve my problem?
Thanks to Simon Charette, who answer this question in django-users:
From the exception it looks like the issue is not related to a missing extension but from an attempt of using and integer as a key. e.g.
instance.hstore_field = {1: 'foo'}
instead of
instance.hstore_field = {'1': 'foo'}
Keys and values in hstore in postgresql are simply text strings (docs) and Django don't convert key object into string. So my HStoreExtension assumption was the wrong way...