Osm2pgsql node underlying way

I would like to know the following with osm2pgsql (i.e. openstreetmap-carto): If you have a node with tags, do you know which ways this node is on? http://wiki.openstreetmap.org/wiki/Osm2pgsql/schema seems to suggest that the table planet_osm_point allows no reference to underlying ways.

Two examples:

  1. There is node railway=halt on a way railway=*. Is there a possiblity to know wether this node is on a railway=rail or on railway=tram?
  2. There is node highway=bus_stop. Is there a possibility to know wether this node is on a closed way public_transport=platform?

There is no way in a database imported with osm2pgsql to distinguish a node that is connected to a way and a node that is on top of a way but not connected.

If it is sufficient to determine whether a node is on top of a way (without caring whether they are connected or not), I think you can make use of ST_overlaps: http://postgis.net/docs/ST_Overlaps.html