PostgreSQL - PL/pgSQL Fundamentals
How can you combine a
WHILE loop with an EXIT WHEN statement to stop the loop when a condition is met in PostgreSQL?