I am trying to migrate some Open Street Maps .osm.pbf
file to my postgresql
database using osm2pgsql
on an ubuntu machine.
When I inspect the data after the process has been finished, the column for tags
is types as text[]
and filled with data like this:
{highway,residential,lit,yes,name,"St. Nicholas Street",name:en,"Saint Nicholas Street",name:mt,"Triq San Nikola"}
Question 1:
- Is that an
hstore
type data? I can't seem to query it as if so. I tried this format:
SELECT * FROM planet_osm_ways WHERE tags ? 'highway' LIMIT 20;
yealding this error:
ERROR: operator does not exist: text[] ? unknown
LINE 1: ...T *, tags as tags FROM planet_osm_ways WHERE tags ? 'highway...
Question 2:
- So assuming the error and format above means that the data was simply not saved as an
hstore
typed data, how can I correct my migration process to fix this?
My process:
- Create a new database using pgAdmin 3 on linux ubuntu.
- add hstore extension to database (pgAdmin)
- add postgis extension to database (pgAdmin)
- super user into postgres user in terminal
osm2pgsql -c -d <DB_NAME> <FILE_PATH> --slim --hstore --multi-geometry
- run migration command:
sudo -u postgres -i
That's it, osm2pgsql
does it's thing and gives out a successful output.
So what am i missing in this process?