I just updated my Postres from 9.1 to 12 and I'm now getting this error message from a specific query:
SQLSTATE[0A000]: Feature not supported: 7 ERROR: set-returning functions are not allowed in CASE LINE 17: generate_series(start_date, ^ HINT: You might be able to move the set-returning function into a LATERAL FROM item.
The actual query generating that error is is part of a much larger on but the actual lines are:
CASE
WHEN num_payments > 1 THEN
generate_series(start_date, start_date + ((payment_interval*(num_payments-1)) || payment_interval2)::interval, (payment_interval::text || payment_interval2)::interval)::date
ELSE
start_date
END
Being the first time seeing this message, I have no idea what this entails. How do I move the set-returning function into a LATERAL FROM item
as the error message hints?