The two-dimensional flow of a stratified fluid over an obstacle