extracted code for finding special selections
Merge branch 'selection_handler' of https://github.com/mpws2013n1/postgres into selection_handler