[postgis-tickets] [PostGIS] #2986: [raster] raster2pgqsql

PostGIS trac at osgeo.org
Sun Nov 9 23:15:00 PST 2014


#2986: [raster] raster2pgqsql
-------------------------+--------------------------------------------------
 Reporter:  rmorelli     |       Owner:  dustymugs    
     Type:  enhancement  |      Status:  new          
 Priority:  medium       |   Milestone:  PostGIS 2.1.5
Component:  raster       |     Version:  2.1.x        
 Keywords:               |  
-------------------------+--------------------------------------------------

Comment(by rmorelli):

 Replying to [comment:1 robe]:
 > rmorelli -- I think there should be a way to escape text.  I don't like
 this workaround because there are other cases where people will want to do
 text filters.

 Me too :-)

 >
 > I know I mentioned the above.  Have you tried using:
 >
 > '' as an escape.  That's the new way of escaping in PostgreSQL and the
 \' was a legacy way which may be turned off in new PostgreSQL.
 >
 > So syntax would be:
 >
 > {{{
 >  DATA "PG:host=localhost port=5432 dbname='xxx' user='xxx'
 password='xxx' schema='raster' table='dem'
 where='filename=''dem20_12.tif''' mode='2'"
 > }}}

 It doesn't work here (PostgreSQL 9.3 - Postgis 2.1.4) shp2img reports
 (again):

 msDrawMap(): Image handling error. Failed to draw layer named 'dem20'.
 <br>
 msDrawRasterLayerLow(): Unable to access file. Corrupt, empty or missing
 file 'PG:host=localhost port=5432 dbname='xxx' user=xxx password=xxx
 schema='raster' table='dem' where='filename='dem20_1.tif'' mode='2'' for
 layer 'dem20'. Error browsing database for PostGIS Raster properties <br>

 >
 > Also you above was missing an apostrophe so wouldn't have worked anyway
 -- might have been my fault when I sent to postgis-users I might have left
 out the other slash

 Sorry, typo error from shell cut and paste and adjust.

 >
 > So correct using slashes would be
 > {{{
 > DATA "PG:host=localhost port=5432 dbname='xxx' user='xxx' password='xxx'
 schema='raster' table='dem' where='filename=\'dem20_12.tif\'' mode='2'"
 > }}}
 >
 > I don't like this proposes since it seems more a work around to
 something that is either an issue or just a misunderstanding with the GDAL
 driver.  I'd much prefer updating the documentation to reflect how to use
 strings.

 Well, I agree with that and quite sure it's an issue.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2986#comment:2>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list