I am using Django 1.2 and the latest version of Postgres.app on MacOS 10.7. When I run manage.py syncdb
to create a database with a PointField in it, I get the following error:
Installing index for stores.Store model
Failed to install index for stores.Store model: operator class "gist_geometry_ops" does not exist for access method "gist"
This are the Postgres commands that I am using beforehand to create a spatial database (after having this problem previously) - none of them produce any errors, which suggests that PostGIS is set up okay:
$ psql -d stores -U storeadmin
# CREATE EXTENSION postgis;
# ALTER TABLE geometry_columns OWNER TO storeadmin;
# ALTER TABLE spatial_ref_sys OWNER TO storeadmin;
Having done a bit of Googling, I'm wondering if perhaps Postgres.app comes with a version of PostGIS that is incompatible with Django 1.2? Should I upgrade to a newer Django? Or should I downgrade to an older PostGIS, and if so, how?
UPDATE: This thread suggests that even Django 1.4 isn't compatible with PostGIS 2. Can I persuade Postgres.app to use an older version? Or should I give up on Postgres.app altogether?
GeoDjango 1.5 has been released with support for PostGIS 2.0. At this point your best option is to upgrade.