#28975: Skip automatic creation of postgis extension if it already exists
-------------------------------------+-------------------------------------
Reporter: sphrak | Owner: sphrak
Type: | Status: assigned
Cleanup/optimization |
Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: create extension, | Triage Stage: Accepted
postgis, psycopg2, postgresql |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Ramiro Morales):
I think the issue reported isn't that creation of the extension must be
skipped if it already exist (as I think that's what the `IF NOT EXISTS
postgis` part of `CREATE EXTENSION IF NOT EXISTS postgis` is about) But
rather that the query is tried unconditionally.
I'd vote for removing the automatic creation of the postgis extension from
`postgis backend DatabaseWrapper.prepare_databse()` we added in 1.8 and
move to having users to perform it explicitly either:
- Manually, externally -- For cases like the OP describes
- Via a migration -- For cases in which the user Django connects to
Postgres as has DB superuser rights there as it's assumed
--
Ticket URL: <https://code.djangoproject.com/ticket/28975#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.019ee429a0631917166d016947e579d8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.