This smells like stored procedures. You can’t unit test it. You can’t version it. Business logic in the database, (hidden brain problem), harder to isolate noisy workloads, no observability, scaling pressure lands solely in Postgres, lack of IO, especially API calls.
Good for local database only jobs though. Niche use cases.
Good for local database only jobs though. Niche use cases.