Often, but seemingly not always, the SQL I write for a view is reformatted upon saving it: it's all reduced to a single long line of code, data-types are added (such as ::text), and the LIKE-operator is changed into a regex. I have no idea what terms to look for to find the cause of this...