小编mmo*_*tes的帖子

SQL 状态:42883,没有函数匹配给定的名称和参数类型。但是那个函数确实存在

我有一个带有 PostgreSQL 8.1.23 的服务器,它的功能在与postgres用户一起运行时完美运行,但与另一个用户一起显示 SQL 状态:

SQL state: 42883
Run Code Online (Sandbox Code Playgroud)

这是我的功能:

CREATE OR REPLACE FUNCTION fun_validatepost(integer, integer)
  RETURNS integer AS
$BODY$
...
$BODY$
LANGUAGE plpgsql VOLATILE;
ALTER FUNCTION fun_validatepost(integer, integer)
  OWNER TO postgres;
GRANT EXECUTE ON FUNCTION fun_validatepost(integer, integer) TO public;
GRANT EXECUTE ON FUNCTION fun_validatepost(integer, integer) TO postgres;
GRANT EXECUTE ON FUNCTION fun_validatepost(integer, integer) TO someuser;
Run Code Online (Sandbox Code Playgroud)

如果我像这样使用 postgres 用户运行它:

select fun_validatepost(1,230465);
Run Code Online (Sandbox Code Playgroud)

结果是这样的:

-[ RECORD 1 ]-----------+--
fun_validatepost        | 1
Run Code Online (Sandbox Code Playgroud)

但是,如果我与 someuser 执行相同的查询,则会显示以下消息:

ERROR:  function fun_validatepost(integer, integer) does not …
Run Code Online (Sandbox Code Playgroud)

postgresql casting function search-path

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

casting ×1

function ×1

postgresql ×1

search-path ×1