Opened 5 years ago
Last modified 4 years ago
#4616 new enhancement
pgsql2shp issues with user defined queries
Reported by: | Algunenano | Owned by: | robe |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS Fund Me |
Component: | utils/loader-dumper | Version: | master |
Keywords: | Cc: |
Description
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
).
Change History (3)
comment:1 by , 5 years ago
Component: | postgis → loader/dumper |
---|---|
Owner: | changed from | to
comment:2 by , 5 years ago
So "SELECT * FROM public.pref" works?
Yes, both SELECT * FROM public.pref
and select * FROM public.pref
work, but not any other combination of lowercase/uppercase.
comment:3 by , 4 years ago
Milestone: | PostGIS 3.1.0 → PostGIS Fund Me |
---|
So "SELECT * FROM public.pref" works?
Yah we should have different entry points to minimize on ambiguity.