I didn't find any information in the PostgreSQL documentation about the classification of translate()
function. Is it classified as an immutable function?
Query the system catalog pg_proc
:
provolatile
tells whether the function's result depends only on its input arguments, or is affected by outside factors. It is i for “immutable” functions, which always deliver the same result for the same inputs. It is s for “stable” functions, whose results (for fixed inputs) do not change within a scan. It is v for “volatile” functions, whose results might change at any time.
select proname, pronamespace::regnamespace, provolatile
from pg_proc
where proname = 'translate'
proname | pronamespace | provolatile
-----------+--------------+-------------
translate | pg_catalog | i
(1 row)
Alternatively, use the function pg_get_functiondef():
select pg_get_functiondef('pg_catalog.translate'::regproc)
pg_get_functiondef
-------------------------------------------------------------------
CREATE OR REPLACE FUNCTION pg_catalog.translate(text, text, text)+
RETURNS text +
LANGUAGE internal +
IMMUTABLE STRICT +
AS $function$translate$function$ +
(1 row)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With