File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -340,24 +340,27 @@ void table_connection_t::stop(bool updateable, bool append)
340340
341341 auto const postgis_version = get_postgis_version ();
342342
343+ auto const geom_column_name =
344+ " \" " + table ().geom_column ().name () + " \" " ;
345+
343346 sql += " ORDER BY " ;
344347 if (postgis_version.major == 2 && postgis_version.minor < 4 ) {
345348 log_debug (" Using GeoHash for clustering table '{}'" ,
346349 table ().name ());
347350 if (table ().geom_column ().srid () == 4326 ) {
348- sql += " ST_GeoHash({},10)" _format (table (). geom_column (). name () );
351+ sql += " ST_GeoHash({},10)" _format (geom_column_name );
349352 } else {
350353 sql +=
351354 " ST_GeoHash(ST_Transform(ST_Envelope({}),4326),10)" _format (
352- table (). geom_column (). name () );
355+ geom_column_name );
353356 }
354357 sql += " COLLATE \" C\" " ;
355358 } else {
356359 log_debug (" Using native order for clustering table '{}'" ,
357360 table ().name ());
358361 // Since Postgis 2.4 the order function for geometries gives
359362 // useful results.
360- sql += table (). geom_column (). name () ;
363+ sql += geom_column_name ;
361364 }
362365
363366 m_db_connection->exec (sql);
You can’t perform that action at this time.
0 commit comments