I'm trying to write a query over a string column called grades_served
that can have values such as
k-5
1-5
5-9
The query could be for a specific grade or it could be a range with a start and end value.
I wanted to check what the best approach would be on this. My gut instinct tells me to reformat the column into a range datatype, but the issue is this is a complex range, with string values, such as k and Pre-K.
I thought about creating a custom type but that seems like an overkill and I've never done that before.
http://www.postgresql.org/docs/9.3/static/sql-createtype.html
Would really appreciate any thoughts or recommendations.