<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>There are several ways to do this. One of the easiest (and most
insecure) is to set the PGPASSWORD environment variable with the
password for "postgres" user in the script before the psql
command.</p>
<p><br>
</p>
<p>Regards</p>
<p>Bo Victor Thomsen</p>
<p>AestasGIS</p>
<p>Denmark<br>
</p>
<br>
<div class="moz-cite-prefix">Den 26/08/16 kl. 15:59 skrev Mark Volz:<br>
</div>
<blockquote
cite="mid:36CA828A36E29F45B7CF0A1766E5DFA372D58F76@swmail01.r8nssis.local"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">Hello,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am having issues with a Windows batch
load script. This script should scan for any new shapefiles
in the “PostGIS Incoming” folder, load the shapefiles into
postGIS, then place the shapefiles in a completed folder.
This script seemed to work in the past, but is now complaining
about a password – which I did not change.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">What is wrong with this script, and or what
can I do to specify a password?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">###########################################<o:p></o:p></p>
<p class="MsoNormal"># LOAD SHAPEFILES INTO POSTGIS SCRIPT<o:p></o:p></p>
<p class="MsoNormal">###########################################<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">set PATH=C:\Program
Files\PostgreSQL\9.2\bin;%PATH%<o:p></o:p></p>
<p class="MsoNormal">cd /d "D:\PostGISIncoming\LyonGIS"<o:p></o:p></p>
<p class="MsoNormal">rem load data to postgis<o:p></o:p></p>
<p class="MsoNormal">for %%f in (*.shp) do shp2pgsql -d -I -s
103749 -W LATIN1 %%f %%~nf | psql -w -U postgres -d lyongis<o:p></o:p></p>
<p class="MsoNormal">rem move data to done folder<o:p></o:p></p>
<p class="MsoNormal">for %%a in (*.*) do move "%%a"
"D:\PostGISIncoming\LyonGIS\Done"<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks <o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">Sincerely,<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="color:#1F497D">Mark Volz,
GISP</span></b><b><span
style="font-size:12.0pt;color:#1F497D"><o:p></o:p></span></b></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/postgis-users">http://lists.osgeo.org/mailman/listinfo/postgis-users</a></pre>
</blockquote>
<br>
</body>
</html>