A co-worker at one point in time has defined a function in AWS Redshift. I have some doubts about its results and would like to see the code behind the function.
Is there any query I can do (or another method) that returns this code?
What are User Defined Functions? UDFs are scalar functions that can be customized and created from the Redshift data warehouse. Each function can accept a fixed number of arguments to return a single output. UDFs can be executed similarly to built in Redshift functions such as replace or lower .
You can create a custom scalar user-defined function (UDF) using either a SQL SELECT clause or a Python program. The new function is stored in the database and is available for any user with sufficient privileges to run. You run a custom scalar UDF in much the same way as you run existing Amazon Redshift functions.
User-defined functions are functions that you use to organize your code in the body of a policy. Once you define a function, you can call it in the same way as the built-in action and parser functions. Variables that are passed to a function are passed by reference, rather than by value.
Found the answer:
select * from pg_proc where proname ilike '%<function_name>%'
In the column: prosrc
you can find the function definition. It seemed empty in SQLWorkbenchJ, but the code revealed itself after a double-click.
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