首页 > 解决方案 > 我无法完成请求,我该怎么办?

问题描述

如何修复该错误(我的代码包含 3 个文件https://github.com/CraigTyle/Mathexp):

test=# select test.complex_Dispersion(c) from t;
ERROR:  function sqr_complex(test.complex) does not exist
LINE 1: SELECT (sqr_complex(comp))
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
QUERY:  SELECT (sqr_complex(comp))
CONTEXT:  PL/pgSQL function dispersion(sqr_complex,complex) line 7 at assignment

有错误的图像

但是,如果我们使用没有“测试”的命令,那么它就可以工作: 看图片

标签: postgresql

解决方案


模式test必须在 your 中search path,否则对对象的每个引用都必须是模式限定的,包括在函数中

您可以通过更改用户来永久添加路径。

ALTER USER username SET search_path TO "$user", public, test;

由于上一条命令只在下次登录时生效,您可以通过应用立即应用

SET search_path TO "$user", public, test;

推荐阅读