[FWTools] ogr2ogr PG connections and password

Bryan Keith bryan at geomega.com
Fri Apr 13 18:22:02 EDT 2007


I'm using ogr2ogr to output data from a postgis database.  An example 
process looks like this:

ogr2ogr -sql "select admin, the_geom from utlanduse where ADMIN = UDOT'" 
temp_py.shp PG:"host=localhost user=xxxxx dbname=statewide password=xxxxx"

I have seen some examples (perhaps incomplete) of people accessing 
postgres with ogr2ogr using just, for example, PG:dbname=statewide

How do I do that?

I have psql and pgsql2shp set up so that I don't have to type in my 
password.  Instead it checks pgpass.conf for the password information. 
Can I setup a password somewhere from ogr2ogr?

Bryan


More information about the FWTools mailing list