Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use "CREATE EXTENSION postgis; ..." on Ubuntu trusty #156

Merged
merged 1 commit into from
Jan 23, 2015

Conversation

mhl
Copy link
Contributor

@mhl mhl commented Jan 6, 2015

As described here:

https://docs.djangoproject.com/en/1.6/ref/contrib/gis/install/postgis/#creating-a-spatial-database-with-postgis-2-0-and-postgresql-9-1

... creating a PostGIS database should be done with
"CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology;"
where PostGIS and PostgreSQL are late enough versions, rather
than the script to create a template_postgis template.

The only supported distribution where we have these versions is
currently Ubuntu trusty.

As described here:

  https://docs.djangoproject.com/en/1.6/ref/contrib/gis/install/postgis/#creating-a-spatial-database-with-postgis-2-0-and-postgresql-9-1

... creating a PostGIS database should be done with
"CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology;"
where PostGIS and PostgreSQL are late enough versions, rather
than the script to create a template_postgis template.

The only supported distribution where we have these versions is
currently Ubuntu trusty.
mhl added a commit to mysociety/commonlib that referenced this pull request Jan 6, 2015
On Ubuntu 14.04 (Trusty Tahr) the script for creating template_postgis
doesn't work, and PostGIS support should be added via CREATE EXTENSION
instead. Any project that uses install_postgis and has been updated to
use this version of commonlib should be updated; for example the
corresponding changes for MapIt are here:

  mysociety/mapit#156
mhl added a commit to mysociety/commonlib that referenced this pull request Jan 6, 2015
On Ubuntu 14.04 (Trusty Tahr) the script for creating template_postgis
doesn't work, and PostGIS support should be added via CREATE EXTENSION
instead. Any project that uses install_postgis and has been updated to
use this version of commonlib should be updated; for example the
corresponding changes for MapIt are here:

  mysociety/mapit#156
@dracos
Copy link
Member

dracos commented Jan 8, 2015

I guess this could future-proof a bit and put debian jessie in already? That looks to have 9.4/2.1.

@dracos
Copy link
Member

dracos commented Jan 9, 2015

Also, looking at our .travis.yml it appears that Django 1.4 does not support using the postgis extension for working with geo database - the commands there work for installing on recent versions of PostgreSQL/PostGIS. This I don't think matters as the install script will use the system Django which is 1.6.1 on trusty, but not sure if this is worth noting/ dealing with in some way.

@stevenday
Copy link
Contributor

Not sure if it will affect this or not, but FYI, it looks like Django 1.8 is going to call CREATE EXTENSION postgis automatically: https://docs.djangoproject.com/en/dev/releases/1.8/#django-contrib-gis

@dracos
Copy link
Member

dracos commented Jan 19, 2015

Django uses IF NOT EXISTS so it won't matter if it already exists.

@dracos dracos merged commit bf08824 into master Jan 23, 2015
mhl added a commit to mysociety/commonlib that referenced this pull request Jan 23, 2015
On Ubuntu 14.04 (Trusty Tahr) the script for creating template_postgis
doesn't work, and PostGIS support should be added via CREATE EXTENSION
instead. Any project that uses install_postgis and has been updated to
use this version of commonlib should be updated; for example the
corresponding changes for MapIt are here:

  mysociety/mapit#156

Also fix the version of the Django script used to one that still
supports Debian squeeze.
@dracos dracos deleted the create-extension-postgis branch December 22, 2015 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants