Tilmann, your suggestion worked. Thank you.
Thank you.
Thank you!
Eduardo, I'm not sure how to make it transactional. I don't know if wrapping the two statements in db_transaction is legitimate or not, but you might experiment with that. I'd look at the underlying ad_form code first, though, to make sure that they look compatible.
I'm really looking forward to upgrading Postgres as some point soon 😊