Opened 4 years ago

Closed 4 years ago

Last modified 4 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 4 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 4 years ago by Tim Graham

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.

Changed 4 years ago by Tim Graham

Attachment: 24645.diff added

comment:2 Changed 4 years ago by Tim Graham

Has patch: set

comment:3 Changed 4 years ago by Zhang Lei

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 Changed 4 years ago by Zhang Lei

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 Changed 4 years ago by Zhang Lei

Resolution: fixed
Status: newclosed

comment:6 Changed 4 years ago by Claude Paroz

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

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

comment:7 Changed 4 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In d3bf5e7b:

Fixed #24645 -- Documented use of HStoreExtension.

comment:8 Changed 4 years ago by Tim Graham <timograham@…>

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