DannyMoshe
DannyMoshe

Reputation: 6265

How to update a UDF in Redshift (amazon)?

I have created a UDF in Redshift. I can view this in the pg_proc table by

select * from pg_proc where proname ilike 'my_udf';

Now i need to update this function (including the function signature). I have tried using update statements on the pg_proc table with no luck.

EDIT: Seems the only way to update the signature is to delete the function although DROP FUNCTION <function_name> does not seems to work.

What is the correct way to do this? Also knowing the function signature would be helpful, is there any way to view that?

Upvotes: 1

Views: 1080

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 270154

You should use CREATE [ OR REPLACE ] FUNCTION... to redefine the User-Defined Function (UDF).

See: CREATE FUNCTION - Amazon Redshift

If the signature is changing, you might need to DROP FUNCTION and then CREATE FUNCTION.

Upvotes: 1

Related Questions