pgsql2shp doesn't work with CTE queries (aka WITH)
|Reported by:||robe||Owned by:||robe|
From the mailing list:
> > $ pgsql2shp ... "WITH foo AS (SELECT 2) SELECT 1" > > Table WITH foo AS (SELECT 2) SELECT 1 does not exist I found a work-around: > $ pgsql2shp ... "SELECT * FROM (WITH foo AS (SELECT 2) SELECT 1) bar" > Initializing... > Done (postgis major version: 3). > Output shape: Null Shape > Dumping: X [1 rows].
The issue is this line:
Which explicitly looks for a SELECT to determine whether to treat the input as a table or query.