Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Database 将OSM数据迁移到PostGreSQL时,如何使用hstore扩展类型?_Database_Postgresql_Openstreetmap_Hstore_Osm2pgsql - Fatal编程技术网

Database 将OSM数据迁移到PostGreSQL时,如何使用hstore扩展类型?

Database 将OSM数据迁移到PostGreSQL时,如何使用hstore扩展类型?,database,postgresql,openstreetmap,hstore,osm2pgsql,Database,Postgresql,Openstreetmap,Hstore,Osm2pgsql,我试图在ubuntu机器上使用osm2pgsql将一些开放街道地图.osm.pbf文件迁移到我的postgresql数据库 当我在流程完成后检查数据时,tags的列类型为text[],并填充如下数据: {highway,residential,lit,yes,name,"St. Nicholas Street",name:en,"Saint Nicholas Street",name:mt,"Triq San Nikola"} 问题1: 这是hstore类型的数据吗?我似乎无法质疑这一点。

我试图在ubuntu机器上使用
osm2pgsql
将一些开放街道地图
.osm.pbf
文件迁移到我的
postgresql
数据库

当我在流程完成后检查数据时,
tags
的列类型为
text[]
,并填充如下数据:

{highway,residential,lit,yes,name,"St. Nicholas Street",name:en,"Saint Nicholas Street",name:mt,"Triq San Nikola"}

问题1:

  • 这是
    hstore
    类型的数据吗?我似乎无法质疑这一点。我尝试了这种格式:
yealding此错误:

ERROR:  operator does not exist: text[] ? unknown
LINE 1: ...T *, tags as tags FROM planet_osm_ways WHERE tags ? 'highway...

问题2:

  • 因此,假设上面的错误和格式意味着数据根本没有保存为
    hstore
    类型化数据,我如何纠正迁移过程来解决这个问题
我的过程:

  • 在linux ubuntu上使用pgAdmin 3创建新数据库
  • 将hstore扩展添加到数据库(pgAdmin)
  • 将postgis扩展添加到数据库(pgAdmin)
  • 终端中超级用户转为postgres用户
  • 就是这样,
    osm2pgsql
    完成了它的工作并给出了一个成功的输出

    那么我在这个过程中遗漏了什么呢

    ERROR:  operator does not exist: text[] ? unknown
    LINE 1: ...T *, tags as tags FROM planet_osm_ways WHERE tags ? 'highway...
    
    osm2pgsql -c -d <DB_NAME> <FILE_PATH> --slim --hstore --multi-geometry
    
    sudo -u postgres -i