The PostgreSQL maths functions and operators can be found
here - I think you should be able to do what you want with "power", although we're a bit short-handed this weekend and I don't have time to experiment with this right now.
If the stat is not from the point of view of the first raiser you can get the position of the first raiser using this expression:
substring(cash_hand_summary.str_aggressors_p from 2 for 1)::int
Assuming both blinds have been posted the number of players who haven't acted yet will be:
2 + substring(cash_hand_summary.str_aggressors_p from 2 for 1)::int
To check that the first raise was an open-raise you can use:
substring(cash_hand_summary.str_actors_p from 1 for 1) = substring(cash_hand_summary.str_aggressors_p from 2 for 1)