I did a test today with Chat GPT and cursors in Postgresql and it was quite good doing a function with a cursor and then calling a function. Definitely speeds up the process of doing SQL if you are stuck in a problem.