This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

osm2pgsql doesn’t work with –hstore flag if hstore extension is not loaded

2

I'm trying to import some OSM data into my postgis database and can't seem to get it to work. The data is an a US state extract from geofabrik that was further reduced using OSM convert to my study area. I checked out the data in QGIS and it looks good.

Below is the error message I receive when run osm2pgsql. I checked the database after running the tool and there is only one table listed "spatial_ref_sys". Any ideas what I'm doing wrong?

C:\Users\moreland_t\Documents\OSM Playground\Data>osm2pgsql tennessee.osm_RPG_01
 -d OSM -U postgres -W secretpassword  -P 5432 -S default.style --hstore
osm2pgsql SVN version 0.69-21289M

Password:
Using projection SRS 900913 (Spherical Mercator)
Setting up table: planet_osm_point
NOTICE:  table "planet_osm_point" does not exist, skipping
NOTICE:  table "planet_osm_point_tmp" does not exist, skipping
CREATE TABLE planet_osm_point ( osm_id int4,"access" text,"addr:flats" text,"add
r:housenumber" text,"addr:interpolation" text,"admin_level" text,"aerialway" tex
t,"aeroway" text,"amenity" text,"area" text,"barrier" text,"bicycle" text,"bridg
e" text,"boundary" text,"building" text,"capital" text,"construction" text,"cutt
ing" text,"disused" text,"ele" text,"embankment" text,"foot" text,"highway" text
,"historic" text,"horse" text,"junction" text,"landuse" text,"layer" text,"learn
ing" text,"leisure" text,"lock" text,"man_made" text,"military" text,"motorcar"
text,"name" text,"natural" text,"oneway" text,"operator" text,"poi" text,"power"
 text,"power_source" text,"place" text,"railway" text,"ref" text,"religion" text
,"residence" text,"route" text,"service" text,"shop" text,"sport" text,"tourism"
 text,"tunnel" text,"waterway" text,"width" text,"wood" text,"z_order" int4,tags
 hstore );
 failed: ERROR:  type "hstore" does not exist
LINE 1: ... text,"width" text,"wood" text,"z_order" int4,tags hstore );
                                                              ^

Error occurred, cleaning up

asked 05 Oct '12, 21:16

T_9er's gravatar image

T_9er
46113
accept rate: 0%

edited 05 Oct '12, 23:05

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273


2 Answers:

5

You need to load the "hstore" extension. How to do this depends on what version of PostgreSQL you're running; it might be as easy as typing create extension hstore in your psql command prompt, or you might have to install a package named postgresql-contrib and from that load the hstore.sql file. Alternatively, leave out the --hstore flag.

answered 05 Oct '12, 23:07

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Thanks for the reply. I was able to load the hstore extension but then ran into several other problems. I'm working on a windows machince and found the following turorial every helpful in finding a fix for the issues I kept running into. https://github.com/springmeyer/win-osm-workshop/blob/master/Tutorial.md#step-6-configure-the-osm-postgis-database

(08 Oct '12, 15:34) T_9er
1

There is no recent version of osm2pgsql for Windows. You may be better off running a linux VM then trying to get everything working on Windows

(08 Oct '12, 19:47) pnorman

-3

answered 05 Oct '12, 22:18

Gnonthgol's gravatar image

Gnonthgol ♦
13.8k16103198
accept rate: 16%

Source code available on GitHub .