I'm starting to doubt the decision to use the Postgres function for business logic. It's so convenient at first sight, but all other elements of the application can't benefit from it without a lot of effort, e.g., observability, logging, error handling, and validation.