Not feeling charitable to the person who has been using reserved words for column names, and is doing SELECT * on everything so I have no idea what columns I'm dealing with.
It wasn't my intent to learn pl/pgsql by fixing someone else's broken* code, but hey.
*It works until it doesn't. Sanitise your inputs, people. And check that they are actually there.
Not fixed, but worked around. The data, as I thought, was broken, and the function wasn't robust enough to tolerate this.
Welcome to thundertoot! A Mastodon Instance for 'straya