We use it extensively for http://nominatim.org/ It's superior when writing loops or even recursive queries that usually require follow-up queries (and thus multiple back-and-forths between your app and the database). Debugging and test-driven development on the other hand is hard. So is versioning functions and updating them. I'd only recommend it if all other options of improving the performance of database queries were tried.
https://github.com/openstreetmap/Nominatim/blob/master/sql/f...