Its called price discrimination[1] and is fairly common practice. It can only really be maintained for a longer time if resale is impossible, and restrictions are added to ensure that market segments buy in the booking class range that has been established for them.
[1]: https://en.wikipedia.org/wiki/Price_discrimination