AshPostgres.Extensions.ImmutableRaiseError (ash_postgres v2.6.24)
View SourceAn extension that installs an immutable version of ash_raise_error.
This can be used to improve compatibility with Postgres sharding extensions like Citus, which requires functions used in CASE or COALESCE expressions to be immutable.
The new ash_raise_error_immutable functions add an additional row-dependent argument to ensure
the planner doesn't constant-fold error expressions.
To install, add this module to your repo's installed_extensions list:
def installed_extensions do
["ash-functions", AshPostgres.Extensions.ImmutableRaiseError]
endAnd run mix ash_postgres.generate_migrations to generate the migrations.
Once installed, you can control whether the immutable function is used by adding this to your repo:
def immutable_expr_error?, do: true