There’s a good tutorial to get to OSM data into PostGIS. (http://richard.dev.openstreetmap.org/osm05.sql.gz) If you’re just interested in testing stuff first, you may want to try this link (http://richard.dev.openstreetmap.org/osm05.sql.gz) which is a 75mb dump of the SQL info, and should get you started. As far as querying the OSM data itself, I don’t think there’s a good way to do, but I could be wrong.