Problem with pgsql2shp - thinks I'm passing a table instead of a query? - Mailing list pgsql-general

From Bryan Montgomery
Subject Problem with pgsql2shp - thinks I'm passing a table instead of a query?
Date
Msg-id CAPTJ3=cQAiiz0pSD=cm-t83-zdZFMqZYk5oK5tEx0wLk_tLOKA@mail.gmail.com
Whole thread Raw
List pgsql-general
Hello,

It seems that the program is thinking I'm passing a table but instead I'm passing a query. Now, I could put a hack in place, create a view and pass that to pgsql2shp but I thought I'd ask whether anyone else has seen this behavior and has a way to force / trick the program to treat the parameter as a query.

I'm using this version $Id: pgsql2shp.c 5451 2010-03-22 19:38:40Z pramsey $ RELEASE: 1.5 USE_GEOS=1 USE_PROJ=1 USE_STATS=1 and run the command below (I've truncated it for brevity), the sql runs fine in pgadmin.

pgsql2shp -h 10.168.111.144 -f FileEg mydb "
SELECT
m.id1,
m.id2,
10 as OPID,
'Name Here' as OPER_NM,
linedesc as SYS_NM,

and more ...

From the server, the sql being passed to it is:
ERROR:  syntax error at or near "Name Here" at character 255

SELECT a.attname, a.atttypid, a.atttypmod FROM pg_attribute a, pg_class c, pg_namespace n WHERE n.nspname = '
        SELECT
        m' AND a.attrelid = c.oid AND n.oid = c.relnamespace AND a.atttypid != 0 AND a.attnum > 0 AND c.relname = 'id1,
        m.id2,
        10 as OPID,
        'Name Here' as OPER_NM,
        linedesc as SYS_NM,
       

pgsql-general by date:

Previous
From: Steve Crawford
Date:
Subject: Re: Large PostgreSQL servers
Next
From: Scott Marlowe
Date:
Subject: Re: Large PostgreSQL servers