PdevG
PdevG

Reputation: 3677

How to find definition of user defined function in AWS Redshift

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?

Upvotes: 10

Views: 9195

Answers (1)

PdevG
PdevG

Reputation: 3677

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.

Upvotes: 23

Related Questions