#3147 closed defect (invalid)
[raster] raster2pgsql should check that the resulting table name it's a valid SQL name.
Reported by: | tinproject | Owned by: | Bborie Park |
---|---|---|---|
Priority: | low | Milestone: | PostGIS Fund Me |
Component: | raster | Version: | 2.1.x |
Keywords: | raster2pgsql | Cc: |
Description
For example, executing:
raster2pgsql 0457h30.tif | psql -d "db" -h "host" -U "user" -W
ends with a table named 0457h30 on the database. That name it's not a valid PostgreSQL table name so a "SELECT * FROM 0457h30;" will fail, also a "DROP TABLE 0457h30;" fails too.
Tested with raster2pgsql RELEASE: 2.1.7 GDAL_VERSION=111 (r13414) on Windows.
Change History (5)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
Milestone: | PostGIS 2.1.8 → PostGIS Future |
---|
comment:3 by , 9 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Given that the table name is valid (the difference between a table called test and Test), I'm calling this invalid.
comment:4 by , 9 years ago
Yes, I forgot about the quotes. I reply here for reference if someone it's facing the same issue:
This error was arise originally in QGIS, importing a PostGIS Raster, as a not useful information error. After long time trying with psql I notice that the problem was the table name. So I suppouse that was a problem with raster2psql, but the real problem it's that QGIS is not quoting the identifiers correctly.
tinproject,
is this error being generated from within raster2pgsql, or just when you manually run those statements.
Normally you pass the table name into raster2pgsql for what you want the new table.
and
if you didn't you should be doing:
since there is nothing technically wrong with a table name 0457j30.
For things like that, not sure I agree that raster2pgsql should try to come up with a name that doesn't require quoting by default. Perhaps as an additional switch option, but I would expect some people might rely on the current behavior, so defintely not something we can put in a micro unless it's actually breaking now in raster2.pgsql.