Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#24645 closed Cleanup/optimization (fixed)

django.db.utils.ProgrammingError: type "hstore" does not exist

Reported by: Zhang Lei Owned by: nobody
Component: Documentation Version: 1.8
Severity: Normal Keywords: type "hstore" does not exist
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I'm using new database field 'HStoreField' in my project, my psycopg2 is 2.6 and postgresql is 9.4.11 with postgres.app. When I using python manage.py migrate, it raise a 'django.db.utils.ProgrammingError' which says django.db.utils.ProgrammingError: type "hstore" does not exist. I have added 'django.contrib.postgres' in my settings.INSTALLED_APPS. I have used ArrayField() with base_field 'CharField' is ok. Only when I using HStoreField, there is error.

Attachments (1)

24645.diff (718 bytes ) - added by Tim Graham 9 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 by Tim Graham, 9 years ago

Component: contrib.postgresDocumentation
Owner: set to nobody
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

You need to create the hstore extension. I ran into this too and will submit a documentation patch.

by Tim Graham, 9 years ago

Attachment: 24645.diff added

comment:2 by Tim Graham, 9 years ago

Has patch: set

comment:3 by Zhang Lei, 9 years ago

Do you mind tell me how to use django.contrib.postgres.operations.HStoreExtension? I have create extension hstore manually in my psql command line. But I have encounter the same problem when I test my project.
Thank you very much.

comment:4 by Zhang Lei, 9 years ago

Ok, I have figured this out. Create a empty migration file and use HStoreExtension. Thank you all the same. please close this ticket or other. Thank you.

comment:5 by Zhang Lei, 9 years ago

Resolution: fixed
Status: newclosed

comment:6 by Claude Paroz, 9 years ago

Resolution: fixed
Status: closednew
Triage Stage: AcceptedReady for checkin

Let's wait for the documentation complement before closing the bug.

comment:7 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: newclosed

In d3bf5e7b:

Fixed #24645 -- Documented use of HStoreExtension.

comment:8 by Tim Graham <timograham@…>, 9 years ago

In 6e5e1a38:

[1.8.x] Fixed #24645 -- Documented use of HStoreExtension.

Backport of d3bf5e7b0016edc02e125699c0b0d3aa93404940 from master

Note: See TracTickets for help on using tickets.
Back to Top