<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2716.2200" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>shp2pgsql doesn't connect to the database - it just
outputs the sql.</FONT></DIV>
<DIV><FONT face=Arial size=2>If you don't want to actually create the sql file,
you can always just pipe the sql output into psql, like this:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>shp2pgsql -c pm.shp pm Geoprocessing | psql
-d Geoprocessing</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Chris</FONT></DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=ycnyon@pd.jaring.my href="mailto:ycnyon@pd.jaring.my">YC Nyon</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=postgis-users@postgis.refractions.net
href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, October 10, 2002 7:04
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [postgis-users] RE: Problwm with
shp2pgsql.exe</DIV>
<DIV><BR></DIV>
<DIV><FONT face=Arial size=2>When I issue this command:</FONT></DIV>
<DIV><FONT face=Arial size=2>C:\postgresql\bin>shp2pgsql -c pm.shp pm
Geoprocessing</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The output is as follows:</FONT></DIV>
<DIV><FONT face=Arial
size=2>---------------------------------------------------------<BR>create
table pm (gid int4 , ID int4);<BR>select
AddGeometryColumn('Geoprocessing','pm','the_geom','-1','MULTIPOLYGON',2);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>begin;<BR>Insert into pm
values('0','0',GeometryFromText('MULTIPOLYGON(((0.194 0.128 ,0.19<BR>4 0.74
,0.846 0.74 ,0.846 0.128 ,0.194 0.128 )))',-1) );end;</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>However, when i check, there is no inserts or
table structure to the Geoprocessing database.</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Then, I tried to generate the sql statements
first:</FONT></DIV>
<DIV><FONT face=Arial size=2>C:\postgresql\bin>shp2pgsql -c pm.shp pm
Geoprocessing > test.sql</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>and</FONT></DIV>
<DIV><FONT face=Arial size=2>C:\postgresql\bin>psql -f test.sql -d
Geoprocessing</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>A check shows the table is present. Connection to
Arcview via extensions and pgsql2shape dump works fine.</FONT></DIV>
<DIV><FONT face=Arial size=2>Did I miss some parameters while issueing the
shp2pgsql.exe command?</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>FYI, I am using the native port of Postgresql
7.2.1 </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Regards</FONT></DIV>
<DIV><FONT face=Arial size=2>Nyon</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV></BLOCKQUOTE></BODY></HTML>