[postgis-tickets] [PostGIS] #4616: pgsql2shp issues with user defined queries

PostGIS trac at osgeo.org
Tue Jan 7 03:16:21 PST 2020


#4616: pgsql2shp issues with user defined queries
-------------------------+---------------------------
 Reporter:  Algunenano   |      Owner:  pramsey
     Type:  enhancement  |     Status:  new
 Priority:  medium       |  Milestone:  PostGIS 3.1.0
Component:  postgis      |    Version:  master
 Keywords:               |
-------------------------+---------------------------
 This works:
 {{{
 ./pgsql2shp -b -f "/tmp/jpn"  "cartodb_dev_user_f80dfdef-ea5c-498d-b98a-
 82362650d944_db" "public.pref"
 Initializing...
 Done (postgis major version: 3).
 Output shape: Polygon
 Dumping: X [47 rows].
 }}}

 But this doesn't:
 {{{
 ./pgsql2shp -b -f "/tmp/jpn"  "cartodb_dev_user_f80dfdef-ea5c-498d-b98a-
 82362650d944_db" "Select * from public.pref"
 Initializing...
 Table pref does not exist
 }}}


 As far as I can see in the logs it's taking `Select * from public` as the
 table or schema name,  And looking at the code it appears it only accepts
 `SELECT` or `select` as the start values of a user defined query.

 I'm not too happy about this, since it means that not only my `Select`
 isn't accepted, but CTEs will fail too. I think having different entry
 points would be the way to go; for example `-t myschema.mytable` or `-c
 "Select * from myschema.mytable`).

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4616>
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