applied patches from https://code.djangoproject.com/attachment/ticket/16...

...778

Conflicts:
	django/contrib/gis/db/backends/postgis/adapter.py