CRDB allows set-returning functions in CASE expressions, while Postgres does not. For example, this succeeds in CRDB but fails in Postgres:
SELECT CASE WHEN true THEN generate_series(1, 3) ELSE 1 END;
The behavior of such an expression is not well-defined, and the results are unexpected, if not down right incorrect. For example:
defaultdb> SELECT CASE WHEN false THEN generate_series(1, 3) ELSE 1 END;
case
--------
1
1
1
(3 rows)
I'd expect this expression to return only a single row.
We should probably disallow set-returning functions within CASE expressions (and other conditional expressions).
Jira issue: CRDB-24525
CRDB allows set-returning functions in CASE expressions, while Postgres does not. For example, this succeeds in CRDB but fails in Postgres:
The behavior of such an expression is not well-defined, and the results are unexpected, if not down right incorrect. For example:
I'd expect this expression to return only a single row.
We should probably disallow set-returning functions within CASE expressions (and other conditional expressions).
Jira issue: CRDB-24525