[postgis-users] shp2pgsql and psql commands in a powershell script?
kjohnson at voiceandnetworksystems.com
Sun Jun 8 14:37:09 PDT 2008
I'm trying to upload the tiger2007fe shape files into postgis 1.3.3 on
postgresql 8.3 on my windows 2003 server.
These are the commands in my powershell script:
shp2pgsql C: \TigerTest\01_ALABAMA\01019_Cherokee\fe_2007_01019_addr
public.01019_addr > C:
psql -d tiger2007fe_test -f C:
There are two issues:
1. the sql command file doesn't pick up the table name from the
shp2pgsql command line. This should be 'public.01019_addr' but shows in the
file as 'public.""'.
I don't have a clue about #1.
2. the psql command wants to prompt for the password. I can use the -U
option for the username, but there doesn't seem to be a way to provide the
password for the named user.
#2 I kind of understand because I know if I logged onto the server as
postgres, I could execute the script. However, there are a number of reasons
I don't like this.
So should I be using some other options for the shp2pgsql that would not
generate a sql command script that I have to execute?
The ogr commands allowed me to provide the necessary values with the 'PG:'
option this way: "dbname=tiger2006se_test user=postgres password=secret"
Is there something like this?
Thanks very much,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the postgis-users