1

Working on upgrading a PostgreSQL 9.6 database to 10+, I am encountering the breaking change that set-returning functions, such as jsonb_object_keys and json_array_elements_text, can no longer be used in CASE expressions.

Where can the definitive list of set-returning functions (including built-ins) be found in PostgreSQL - it doesn't appear that there is a reference in the PostgreSQL documentation, and the result set of SELECT * FROM information_schema.routines does not appear to have an obvious column that indicates 'result type is a set'.

2
  • 1
    Unrelated, but: I hope you are not upgrading to 10 as that is EOL in about 3 months as well Commented Aug 18, 2022 at 4:58
  • Yep, definitely upgrading to 14! Commented Sep 4, 2022 at 0:18

1 Answer 1

1

Query the system catalog pg_proc.

select *
from pg_proc
where proretset

According to the documentation the column proretset contains this information.

proretset bool

Function returns a set (i.e., multiple values of the specified data type)

See also PostgreSQL error: CASE with JSON set-returning functions

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.