Import data in PgSql but cant see a node that exists in OpenStreetMap

Hi i was able to import data from using osm2pgsql the steps that i used are:

1- createuser -U postgres utest
2- createdb -U postgres -E UTF8 -O utest osm
3- Execute the query in the PostgreSQL 9.6 DB: create extension postgis;
4- osm2pgsql -cGs -d osm -S /usr/local/share/osm2pgsql/ /Users/XXX/Documents/OSM/argentina-latest.osm.pbf

Those steps imports the data in the DB osm in Postgres correctly

To test the data i tried this query

select, city.osm_id from planet_osm_polygon city limit 10 wich return the 10 rows

but when i tried to search for my neighborhood “Corral de Palos”

select, city.osm_id from planet_osm_polygon city where name = ‘Corral de Palos’ returns 0 rows…

select, city.osm_id from planet_osm_polygon city where name like ‘%orral %’ returns many rows but none with the name “Corral de Palos”

However in OpenStreetMaps “Corral de Palos” exists

I download again the pbf from geofabrik and get the same results, also i tried and create the region for Argentina downloaded the generated pbf and import to the db with the same result i cant find the neighborhood.

There is something wrong on how i import the data?
I’m missing a step?


I’m no specialist on this topic, but you query the polygon table, while the Corral de Palos link on Nominatim points to a node.

You are not a specialist but a Genious!!! you point me to the right direction:

SELECT planet_osm_nodes.*, pg_column_size(planet_osm_nodes.tags) AS column_size
FROM planet_osm_nodes
JOIN (SELECT id, unnest(tags) AS strings FROM planet_osm_nodes) AS id_strings USING (id)
WHERE id_strings.strings = ‘Corral de Palos’;

Now i get the info that i need.

Thank you