PostgreSQL SQL syntax - JOIN and substrings
select a.host, b.host, b.volume
from hosts as a
  join hosts as b 
    on b.volume like '%'||a.volume||'%' 
   and a.host &lt;&gt; b.host;


Instead of LIKE you can also use position which might be easier to read:

select a.host, b.host, b.volume
from hosts as a
  join hosts as b 
    on a.host &lt;&gt; b.host
   and position(a.volume in b.volume) &gt; 0 


SQLFiddle: http://sqlfiddle.com/#!15/a67c5/1