在Postgres中是否有类似SQL Server的UDF(其中一个函数可以在DLL中导出并作为SQL Server中的函数导入)?
例如,我要导入的函数具有以下签名:
public static extern double* svd(double[] a, int d);
Dll导入如下所示:
[DllImport("D:\\my.dll", EntryPoint = "mydll")]
答案 0 :(得分:0)
您可以使用Postgres中的Create Function
:
CREATE FUNCTION svd(double*, int) RETURNS double*
AS 'c:/path/mydll.dll'
LANGUAGE 'C';
更多信息:http://www.postgresql.org/docs/current/static/xfunc-c.html
您可能需要使用复合类型,因为看起来您正在使用可变数量的行和列操作基质。