While using osm2pgsql 1.6 i am trying to dump PBF into specific schema of postgres DB using following commands using docker. (i am setting database properties in docker env)

docker run -v /mnt/ne-blobs/:/mnt/ne-blobs/ --env PGHOST=$PGHOST --env PGPORT=$PGPORT --env PGUSER=$PGUSER --env PGDATABASE=$PGDATABASE --env PGPASSWORD=$PGPASSWORD osm2pgsql:1.6.0 osm2pgsql -c -E 4326 --hstore --slim -C 8000 --output-pgsql-schema=$schema_name -r pbf /path/to/pbf.

I am creating schema before executing this command but i see that only planet_osm_line planet_osm_point planet_osm_polygon planet_osm_roads

are getting created in my mentioned schema

but core tables like Planet_osm_nodes planet_osm_rels planet_osm_ways

are getting created in public schema. Is there anything i am doing wrong with the command? i want to create all 7 tables in one schema which is execution specific.

1 Answer 1


You should use also these Middle Options https://osm2pgsql.org/doc/man/version-1-6-0.html in your command:

--tablespace-slim-data=TABLESPC Store the slim mode tables in the given tablespace.

--tablespace-slim-index=TABLESPC Store the indexes of the slim mode tables in the given tablespace.

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.