James
James

Reputation: 97

How do I copy a function to another schema?

I want to know if it is possible to copy a function in another schema mantaining the function in the original schema.

Upvotes: 0

Views: 1902

Answers (1)

Vao Tsun
Vao Tsun

Reputation: 51609

if you use psql, run \sf schemaname.fn to get definition. if other client:

select prosrc from pg_proc where proname ='fn_name'

then just change schema name to another one and you have it in two schemas...

Of course they are completly isolated, thus changing the function in one schema won't affect function with same name in other schema

Upvotes: 2

Related Questions