The are several loaders for OSM, aimed at different end uses -- routing, rendering with Mapnik, raw format. It can be a somewhat confusing at first to understand the differences, and the all produce difference output tables.

***osm2pgrouting*** imports OSM in a format that is optimized for routing, ie, nodes and edges (with costs). It does not include any geocoding information that will allow you to enter an address and get an osm_id that you can link back to a start or end node in a routing calculation.

If you want geocoding in OSM, you can use the [nominatum service](http://wiki.openstreetmap.org/wiki/Nominatim), for example, from the docs:

>http://nominatim.openstreetmap.org/search?q=135+pilkington+avenue,+birmingham&format=xml&polygon=1&addressdetails=1

which returns JSON including the osm_id of the node, eg,


 
    <searchresults timestamp="Sat, 07 Nov 09 14:42:10 +0000" querystring="135 pilkington, avenue birmingham" polygon="true">
    <place 
      place_id="1620612" osm_type="node" osm_id="452010817"
    ...... etc 
      

In order to get OSM data in a format including address information, you need to use the [osmosis loader](http://wiki.openstreetmap.org/wiki/Osmosis) which loads the data into the native format of OSM: ways, nodes and relations table, complete with the hstore tags columns, which contain key/value pairs containing extra information such as an address, a highway type, etc.

If you install nominatim locally (plus **osmosis**, which is part of that process), then to create your routing table you can use the [pgr_createTopology function]( http://docs.pgrouting.org/2.0/en/src/common/doc/functions/create_topology.html), passing in the ways table as the edge table, eg:

    SELECT pgr_createTopology('ways', 0.0001);

However, in practice, I have found this function to be very fussy, and you might be better of using osmosis and osm2pgrouting separately, or use osm2pgrouting and use the external nominatim geocoder service to match you addresses to osm_ids.