Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id DC4A3B5DC5A for ; Mon, 8 Aug 2011 11:45:44 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 98345-06 for ; Mon, 8 Aug 2011 14:45:38 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sam.nabble.com (sam.nabble.com [216.139.236.26]) by mail.postgresql.org (Postfix) with ESMTP id 30FBEB5DBF3 for ; Mon, 8 Aug 2011 11:45:35 -0300 (ADT) Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1QqR5C-0001xG-NY for pgsql-admin@postgresql.org; Mon, 08 Aug 2011 07:45:34 -0700 Date: Mon, 8 Aug 2011 07:45:34 -0700 (PDT) From: antismarmy To: pgsql-admin@postgresql.org Message-ID: <1312814734716-4677943.post@n5.nabble.com> Subject: pgsql2shp error when query is introduced MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.777 tagged_above=-10 required=5 tests=BAYES_00=-1.9, TVD_SUBJ_NUM_OBFU_MINFP=0.001, URI_HEX=1.122 X-Spam-Level: X-Archive-Number: 201108/27 X-Sequence-Number: 38014 Hi Community, I am trying to create a shp file from the command line by using pgsql2shp for a specific query of an existing database table. I am able to use this command to create a shp without the query where the database name is forGgis and the table name is COVER63p_prj32119: C:\Program Files (x86)\OpenGeo\OpenGeo Suite\pgsql\8.4\bin>.\pgsql2shp.exe -f C:\temp\test03.shp -h localhost -u postgres -p 54321 forQgis public.COVER63p_prj32119 Also, I am able to get the desired results of the query from the sql editor pgAdmin III using: SELECT * FROM public."COVER63p_prg32119" WHERE "COVER63p_prg32119".cover = 'woods'; However, when I drop the table name from the end of the previously working command and add the query information to the end of the command line: C:\Program Files (x86)\OpenGeo\OpenGeo Suite\pgsql\8.4\bin>.\pgsql2shp.exe -f C:\temp\test04.shp -h localhost -u postgres -p 54321 forQgis "SELECT * FROM public.COVER63p_prg32119 WHERE COVER63p_prg32119.cover = 'woods'" I see.... Preparing table for user query... Failed: ERROR: relation "public.cover63p_prg3 2119" does not exist LINE 1: ...ABLE "__pgsql2shp5596_tmp_table" AS SELECT * FROM public.COV... (there was a carrot pointing to the p in public after the FROM) I have tried this statement in many different configurations using single quotes, double quotes, and without using the "." functionality to be more specific about where the table is stored and which table holds the variable of interest for the where part of the statement. Any thoughts? Something must be wrong with my syntax??? Thanks, Stacy -- View this message in context: http://postgresql.1045698.n5.nabble.com/pgsql2shp-error-when-query-is-introduced-tp4677943p4677943.html Sent from the PostgreSQL - admin mailing list archive at Nabble.com.