I second this approach as it should be normalized into two fields. It would then be a simple order by area. i.e. order by width * height This would work in the meantime, given the data format doesn’t change: order by split_part(print_size, 'x', 1)::int * split_part(print_size, 'x', 2)::int |