Many thanks Tom and David for clarifying the semantics.
/Joel
"Joel Jacobson" writes:
> Is it idiomatic and safe to use
> SELECT
> CASE boolean_expression WHEN TRUE THEN function_with_side_effects() END
> in a query to ensure the function_with_side_effects() is only
> execute if boolean_expression is true?
As long as function_with_side_effects() is
On Tue, Jan 12, 2021 at 1:14 AM Joel Jacobson wrote:
> Is it idiomatic and safe to use
>
> SELECT
> CASE boolean_expression WHEN TRUE THEN function_with_side_effects() END
>
As long as function_with_side_effects() is defined volatile it is forced to
be executed at runtime, once per row. That
Is it idiomatic and safe to use
SELECT
CASE boolean_expression WHEN TRUE THEN function_with_side_effects() END
...
in a query to ensure the function_with_side_effects() is only
execute if boolean_expression is true?
function_with_side_effects() is known to be a normal function,
and not an