Re: [Django] #32721: Geometry Index with PostGIS using schema

2021-11-15 Thread Django
#32721: Geometry Index with PostGIS using schema
-+-
 Reporter:  Alan D. Snow |Owner:  Alan D.
 |  Snow
 Type:  Bug  |   Status:  closed
Component:  GIS  |  Version:  3.2
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham):

 The first commit here makes the GIST_GEOMETRY_OPS_ND opclass disappear
 from the creation of PostGIS's 3D geometry indexes (#33294).

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.00548ee16f614c356b01ec97e526ace5%40djangoproject.com.


Re: [Django] #32721: Geometry Index with PostGIS using schema

2021-05-13 Thread Django
#32721: Geometry Index with PostGIS using schema
-+-
 Reporter:  Alan D. Snow |Owner:  Alan D.
 |  Snow
 Type:  Bug  |   Status:  closed
Component:  GIS  |  Version:  3.2
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"29345aecf6e8d53ccb3577a3762bb0c263f7558d" 29345aec]:
 {{{
 #!CommitTicketReference repository=""
 revision="29345aecf6e8d53ccb3577a3762bb0c263f7558d"
 Fixed #32721 -- Fixed migrations crash when adding namespaced spatial
 indexes on PostGIS.
 }}}

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.80750b699454747f33acb0a886850de8%40djangoproject.com.


Re: [Django] #32721: Geometry Index with PostGIS using schema

2021-05-13 Thread Django
#32721: Geometry Index with PostGIS using schema
-+-
 Reporter:  Alan D. Snow |Owner:  Alan D.
 |  Snow
 Type:  Bug  |   Status:  assigned
Component:  GIS  |  Version:  3.2
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Mariusz Felisiak ):

 In [changeset:"99bc67a9e79256d8a2fcd5742e33a5e79c056539" 99bc67a]:
 {{{
 #!CommitTicketReference repository=""
 revision="99bc67a9e79256d8a2fcd5742e33a5e79c056539"
 Refs #32721 -- Made PostGISSchemaEditor._create_index_sql() call
 super()._create_index_sql().
 }}}

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.a5d92eec0b6bbeaf243e764520db030a%40djangoproject.com.


Re: [Django] #32721: Geometry Index with PostGIS using schema

2021-05-13 Thread Django
#32721: Geometry Index with PostGIS using schema
-+-
 Reporter:  Alan D. Snow |Owner:  Alan D.
 |  Snow
 Type:  Bug  |   Status:  assigned
Component:  GIS  |  Version:  3.2
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * needs_better_patch:  1 => 0
 * stage:  Accepted => Ready for checkin


-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.7a1f8d00442d146e74ecdff8655c194c%40djangoproject.com.


Re: [Django] #32721: Geometry Index with PostGIS using schema

2021-05-06 Thread Django
#32721: Geometry Index with PostGIS using schema
--+
 Reporter:  Alan D. Snow  |Owner:  Alan D. Snow
 Type:  Bug   |   Status:  assigned
Component:  GIS   |  Version:  3.2
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Mariusz Felisiak):

 * needs_better_patch:  0 => 1


-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.5fec3208fd3c5c68507274fbb49a12bf%40djangoproject.com.


Re: [Django] #32721: Geometry Index with PostGIS using schema

2021-05-06 Thread Django
#32721: Geometry Index with PostGIS using schema
--+
 Reporter:  Alan D. Snow  |Owner:  Alan D. Snow
 Type:  Bug   |   Status:  assigned
Component:  GIS   |  Version:  3.2
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by Alan D. Snow):

 Happy to submit a patch. Ref: https://github.com/django/django/pull/14364

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.df1df4189f2eb7ddea5692e1bf5432b6%40djangoproject.com.


Re: [Django] #32721: Geometry Index with PostGIS using schema

2021-05-06 Thread Django
#32721: Geometry Index with PostGIS using schema
--+
 Reporter:  Alan D. Snow  |Owner:  Alan D. Snow
 Type:  Bug   |   Status:  assigned
Component:  GIS   |  Version:  3.2
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Alan D. Snow):

 * owner:  nobody => Alan D. Snow
 * status:  new => assigned
 * has_patch:  0 => 1


-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.3bede96fa7c4a7dc4e58f91f65e9ff2d%40djangoproject.com.


Re: [Django] #32721: Geometry Index with PostGIS using schema

2021-05-06 Thread Django
#32721: Geometry Index with PostGIS using schema
--+
 Reporter:  Alan D. Snow  |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  GIS   |  Version:  3.2
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Mariusz Felisiak):

 * stage:  Unreviewed => Accepted


Comment:

 Thanks it looks valid, we should use the `_create_index_name()` hook
 instead, e.g. `self._create_index_name(model._meta.db_table,
 [field.column], suffix='_id')`. Would you like to prepare a patch? (tests
 are required).

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.2bf10b81b39a22ef3cdf96ff1fa81e47%40djangoproject.com.


Re: [Django] #32721: Geometry Index with PostGIS using schema

2021-05-06 Thread Django
#32721: Geometry Index with PostGIS using schema
--+--
 Reporter:  Alan D. Snow  |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  GIS   |  Version:  3.2
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Unreviewed
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+--
Description changed by Alan D. Snow:

Old description:

> If you have a model like this:
> {{{
> from django.contrib.gis.db import models as gis_models
> from django.db import models
>
> class MyModel(models.Model):
> geometry = gis_models.GeometryField(
> help_text="The area of interest.",
> spatial_index=True,
> srid=4326,
> )
> class Meta:
> db_table = 'source"."mymodel'
> }}}
>
> When you go to run migrations, this error occurs:
> {{{
> self = 
> sql = 'CREATE INDEX "source"."mymodel_geometry_id" ON "source"."mymodel"
> USING GIST ("geometry")'
> params = ()
> ignored_wrapper_args = (False, {'connection':
>  0x7f3002ab6790>, 'cursor':  at 0x7f3001dcadc0>})
>
> def _execute(self, sql, params, *ignored_wrapper_args):
> self.db.validate_no_broken_transaction()
> with self.db.wrap_database_errors:
> if params is None:
> # params default might be backend specific.
> return self.cursor.execute(sql)
> else:
> >   return self.cursor.execute(sql, params)
> E   psycopg2.errors.SyntaxError: syntax error at or near "."
> E   LINE 1: CREATE INDEX "source"."mymodel_geometry_id" ON
> "sour...
> E^
>
> }}}
>
> Currently, the code that generates the name is here:
> https://github.com/django/django/blob/65a9d0013d202447dd76a9cb3c939aa5c9d23da3/django/contrib/gis/db/backends/postgis/schema.py#L35-L38
> {{{
> if kwargs.get('name') is None:
> index_name = '%s_%s_id' % (model._meta.db_table,
> field.column)
> else:
> index_name = kwargs['name']
> }}}
>
> This produces the index name (as seen in the error above):
> source"."mymodel_geometry_id
>
> We have been patching this internally with this code instead:
> {{{
> name = kwargs.get("name")
> if name is None:
> name = self._create_index_name(
> table, [field.column], kwargs.get("suffix", "")
> )
> }}}
>
> This makes the name something like:
> mymodel_geometry_26ff3048
>
> Is this a patch you would like to see? Or do you have a different
> recommended solution?

New description:

 If you have a model like this:
 {{{
 from django.contrib.gis.db import models as gis_models
 from django.db import models

 class MyModel(models.Model):
 geometry = gis_models.GeometryField(
 help_text="The area of interest.",
 spatial_index=True,
 srid=4326,
 )
 class Meta:
 db_table = 'source"."mymodel'
 }}}

 When you go to run migrations, this error occurs:
 {{{
 self = 
 sql = 'CREATE INDEX "source"."mymodel_geometry_id" ON "source"."mymodel"
 USING GIST ("geometry")'
 params = ()
 ignored_wrapper_args = (False, {'connection':
 , 'cursor': })

 def _execute(self, sql, params, *ignored_wrapper_args):
 self.db.validate_no_broken_transaction()
 with self.db.wrap_database_errors:
 if params is None:
 # params default might be backend specific.
 return self.cursor.execute(sql)
 else:
 >   return self.cursor.execute(sql, params)
 E   psycopg2.errors.SyntaxError: syntax error at or near "."
 E   LINE 1: CREATE INDEX "source"."mymodel_geometry_id" ON
 "sour...
 E^

 }}}

 Currently, the code that generates the name is here:
 
https://github.com/django/django/blob/65a9d0013d202447dd76a9cb3c939aa5c9d23da3/django/contrib/gis/db/backends/postgis/schema.py#L35-L38
 {{{
 if kwargs.get('name') is None:
 index_name = '%s_%s_id' % (model._meta.db_table, field.column)
 else:
 index_name = kwargs['name']
 }}}

 This produces the index name (as seen in the error above):
 source"."mymodel_geometry_id

 We have been patching this internally with this code instead:
 {{{
 name = kwargs.get("name")
 if name is None:
 name = self._create_index_name(
 model._meta.db_table, [field.column], kwargs.get("suffix",
 "")
 )
 }}}

 This makes the name something like:
 mymodel_geometry_26ff3048

 Is this a patch you would like to see? Or do you have a different
 

[Django] #32721: Geometry Index with PostGIS using schema

2021-05-06 Thread Django
#32721: Geometry Index with PostGIS using schema
+
   Reporter:  Alan D. Snow  |  Owner:  nobody
   Type:  Bug   | Status:  new
  Component:  GIS   |Version:  3.2
   Severity:  Normal|   Keywords:
   Triage Stage:  Unreviewed|  Has patch:  0
Needs documentation:  0 |Needs tests:  0
Patch needs improvement:  0 |  Easy pickings:  0
  UI/UX:  0 |
+
 If you have a model like this:
 {{{
 from django.contrib.gis.db import models as gis_models
 from django.db import models

 class MyModel(models.Model):
 geometry = gis_models.GeometryField(
 help_text="The area of interest.",
 spatial_index=True,
 srid=4326,
 )
 class Meta:
 db_table = 'source"."mymodel'
 }}}

 When you go to run migrations, this error occurs:
 {{{
 self = 
 sql = 'CREATE INDEX "source"."mymodel_geometry_id" ON "source"."mymodel"
 USING GIST ("geometry")'
 params = ()
 ignored_wrapper_args = (False, {'connection':
 , 'cursor': })

 def _execute(self, sql, params, *ignored_wrapper_args):
 self.db.validate_no_broken_transaction()
 with self.db.wrap_database_errors:
 if params is None:
 # params default might be backend specific.
 return self.cursor.execute(sql)
 else:
 >   return self.cursor.execute(sql, params)
 E   psycopg2.errors.SyntaxError: syntax error at or near "."
 E   LINE 1: CREATE INDEX "source"."mymodel_geometry_id" ON
 "sour...
 E^

 }}}

 Currently, the code that generates the name is here:
 
https://github.com/django/django/blob/65a9d0013d202447dd76a9cb3c939aa5c9d23da3/django/contrib/gis/db/backends/postgis/schema.py#L35-L38
 {{{
 if kwargs.get('name') is None:
 index_name = '%s_%s_id' % (model._meta.db_table, field.column)
 else:
 index_name = kwargs['name']
 }}}

 This produces the index name (as seen in the error above):
 source"."mymodel_geometry_id

 We have been patching this internally with this code instead:
 {{{
 name = kwargs.get("name")
 if name is None:
 name = self._create_index_name(
 table, [field.column], kwargs.get("suffix", "")
 )
 }}}

 This makes the name something like:
 mymodel_geometry_26ff3048

 Is this a patch you would like to see? Or do you have a different
 recommended solution?

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.bd55e6760c2c3fdfdbea97700c84a9e8%40djangoproject.com.