[gdal-dev] Non-standard characters in GeoPackage table names

Jukka Rahkonen jukka.rahkonen at maanmittauslaitos.fi
Sun Aug 2 04:52:53 PDT 2015


Even Rouault <even.rouault <at> spatialys.com> writes:

> 
> On Saturday 01 August 2015 13:35:30 Jukka Rahkonen wrote:
> > Hi,
> > 
> > Have a look at this QGIS issue https://hub.qgis.org/issues/13140.
> 
> Jukka,
> 
> I guess this report must be a QGIS running against GDAL 1.11. There has
been a 
> bug fix in GDAL 2.0 to always quote identifiers ( 
> https://trac.osgeo.org/gdal/ticket/5472 ), so now "test-table" is a valid 
> table name.
> 
> I guess the applicable standard is SQL-92, with which SQLite is largely 
> conformant, which allows unusual characters to be used in identifiers
provided 
> the identifier is properly quoted. I doubt the GeoPackage standard would want 
> to specify over that, but you could potentially raise it to 
> https://lists.opengeospatial.org/mailman/listinfo/geopackage
> 
> Another possibility would be for GDAL to "launder" identifiers by default
like 
> it does in a few drivers like PostGIS. The laundering as implemented in that 
> driver consists in converting to lowercase (works properly only on ASCII 
> characters as currently implemented) and replacing single quote, dash and 
> sharp characters by underscore.

Third and and perhaps best possibility might be to edit the "Annex A
Conformance / Abstract Test Suite (Normative)" part of the GeoPackage
standard to use quoted identifiers everywhere. Now the first test in the
test suite that fails with "test-table" seems to be already the third one:

 A.1.1.1.1.3 File Contents
Test Case ID: /base/core/container/data/file_contents
Test Purpose: Verify that the Geopackage only contains specified contents
Test Method:
1) For each gpkg_* table_name
a) PRAGMA table_info(table_name)
...

Should be written as PRAGMA table_info("table_name")...
There must be quite many other tests which can fail in a similar way with
unquoted table names.

Anyway, good to know that GDAL 2.0 behaves right.

-Jukka-






More information about the gdal-dev mailing list