[postgis-users] pgsql2shp postgres

Obe, Regina robe.dnd at cityofboston.gov
Fri Apr 20 03:41:35 PDT 2007


Anhtin,

I think you asked before and no one responded to that part of your
question so in case you are still wondering

 
pgsql2shp is a command line tool so it has to be run from unix sh or
windows command shell not from within postgresql.

It is not really designed to be run from within the postgresql
environment like you would just write select statements etc.  I suppose
if you really wanted to run within postgresql then you could probably
create a procedure using plperl procedural language or something like
that to do it or you could run it using PgAgent (that comes packaged
with PgAdmin).

Ignore this if Mark answered your question; I just wasn't quite sure
from the way you phrased your question if that was what you were asking.

Thanks,
Regina

   

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Mark
Cave-Ayland
Sent: Friday, April 20, 2007 4:22 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] pgsql2shp postgres

On Fri, 2007-04-20 at 01:01 -0700, anhtin wrote:
> hi all
> i have command export post to shap file
> pgsql2shp -f myshp -h myserver -u apguser -P apgpassword mygisdb
>  "select * from province WHERE id IN(1,2,3,4,67,34)
>  and geom && SetSRID('BOX3D(295149 2315499, 465992
2163790)'::box3d,-1)"
> but i want run this command on Database Postgres
> How can i do that ????


Hi Anhtin,

You're not far off in your example above: change mygisdb to the name of
your database. Have you tried reading the help file? See pgsql2shp -?
for more information.

Also, the postgres database is actually designed for internal usage
(similar to template0/template1) so you don't really want to be putting
any user data in there...


Kind regards,

Mark.


_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.




More information about the postgis-users mailing list