1

I got error message, when loading osm file to PostgreSQL by osm2pgsql command. I run the following command line :

osm2pgsql -c -G -U postgres --hstore -S D:\osm2pgsql\default.style  -U postgres -W mypassword -d osm -r "D:\.....roads.osm"

and i got this error message:

Osm2pgsql failed due to ERROR: Open failed for 'mypassword': The system cannot find the file specified.

1 Answer 1

1

As advised in the doc, you can get a full list of options using osm2pgsql -h -v

  • you have specified twice the -U postgres parameter
  • -W is a password prompt. The alternative (without -W) is to save the password in the PGPASS environment
  • -r should take a parameter or be removed (same as -r auto)
  • the input file(s) is specified without a parameter name. Since the -W (password prompt) is not expected to be followed by a value, the found value is interpreted as an input file name and triggers the error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.