mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 06:00:46 -05:00
CREATE [OR REPLACE] EXTERNAL FUNCTION and DROP FUNCTION are now handled on Redshift clusters. Each function's Lambda name, IAM role, volatility and batch options are kept in ExternalFunctionRegistry, and a plpgsql stub of the same signature is created in the backend, so name clashes, overloads, ownership and OR REPLACE return-type rules come from PostgreSQL. OR REPLACE replaces only a function the registry made. Calling the function raises 0A000 until the evaluator lands. IMMUTABLE, IAM_ROLE default and types outside the documented Lambda UDF list are refused with 0A000, malformed clauses with 42601 and out-of-range options with 22023; the clause defaults and bounds follow the CREATE EXTERNAL FUNCTION reference. A DROP FUNCTION of a function Floci does not track is left to PostgreSQL. Both statements fail with 25001 inside a transaction block, and an unqualified name is created in public. Part of #7815.