[postgis-users] loading sql files using batch commands - psql

Mike Hostetler mike at squarepegsystems.com
Tue Nov 20 15:04:44 PST 2012


Google for the pgpass file. That's how I get around this.
On Nov 20, 2012 1:01 PM, "Mark Volz" <MarkVolz at co.lyon.mn.us> wrote:

> Hello,
>
> I am trying to create a batch program that will update postgis from a
> directory of shapefiles.  I came across
> http://suite.opengeo.org/opengeo-docs/dataadmin/pgGettingStarted/shp2pgsql.html,
> which uses psql to load data into postgis.  The psql command appears to
> prompt for a password, which would be fine if I was manually running the
> batch file.  However, I want to set up a scheduled task in windows so that
> my data gets updated on automatic intervals.
>
> Is there a way to store a password in a batch file such as " for %%f in
> (*.sql) do psql -p 5432 -w -U postgres --password mypassword --dbname
> postgis20 -f %%f?
> If not is there a way to trick a windows batch file to send the password
> to psql?
>
> Thanks for any help
>
> Mark Volz
> GIS Specialist
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20121120/0339dd06/attachment.html>


More information about the postgis-users mailing list