I’m working on a map for which I need some relations extracted from the OSM database. I use osm2pgsql with slim mode to get the additional three tables.
I find the relations in the table planet_osm_lines, but unfortunately more than one row per relation. That causes some trouble later on to give these relations certain properties.
In the table planet_osm_rels I have only one row per relation (what is fine), but the tags are stored as text arrays, and so it is difficult to select certain tag-value pairs. I tried it with ANY, but I can select only key or value but not the pair. The SQL “SELECT * FROM planet_osm_rels WHERE ‘key’ = ANY (tags) AND ‘value’ = ANY (tags)” gives me all rows where ‘key’ and ‘value’ are keys OR values BUT NOT as a pair.
Has anyone tried to select key/value pairs from this table using the tags column?