postgresql - It's possible to call functions in another schema from within plv8 functions? -
i'm trying use plv8 write postgres functions. use pgcrypt library in way this:
create or replace function v01.myfunction(arg json) returns json $body$ var res; res = obj.crypt(arg.password, res); plv8.elog(notice, res); ... $body$ language plv8; where crypt comes pgcrypt library , find in schema. if running error:
error: referenceerror: obj not defined any idea? thanks!
it's possible call other plv8 functions in other schemas, yes.
you're not calling function right though. use
var myfunction = plv8.find_function("schemaname.functionname") var result = myfunction(); afaik can call other plv8 functions way, not plpgsql.
you can use plv8.execute("select somefunctioninanotherlanguage()")
Comments
Post a Comment