Postgres Osm2pgsql Error: role does not exist
You didn't specify -U|--username
switch, so osm2pgsql
gets current username from terminal (unless you set PGUSER
environment variable). Error message looks very clear, telling that role named myUsername
does not exist in your database cluser. Note that:
CREATE ROLE myUsername LOGIN; -- creating role myusernameCREATE ROLE "myUsername" LOGIN; -- creating role myUsername
will produce two different roles:
SELECT rolname FROM pg_roles; rolname ------------ postgres myUsername myusername(3 rows)
I know this is an old question but things have changed in OSM and this answer appears to be at the top of a Google search
Use this:
/usr/bin/install-postgis-osm-user.sh the-database-here your-username-here
for example
/usr/bin/install-postgis-osm-user.sh gis barrythefish