错误:没有函数与给定的名称和参数类型匹配 [英] Error: No function matches the given name and argument types

查看:265
本文介绍了错误:没有函数与给定的名称和参数类型匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使此功能运行.当我使用pgadmin并使用

I try to get this function running. When I use pgadmin and manually call this function with

SELECT calculate_something(7)SELECT common.calculate_something(7)

ERROR: function calculate_something(integer) doesn't exist hint no function matches the given name and argument types (从德语翻译)

ERROR: function calculate_something(integer) doesn't exist hint no function matches the given name and argument types (translated from german)

我已经尝试过呼叫SELECT calculate_something(cast(7 as bigint));

该函数或演员表出了什么问题? :/

What is wrong with that function or cast? :/

CREATE OR REPLACE FUNCTION common.calculate_something(id bigint)
  RETURNS real AS
$BODY$
  DECLARE
    some_value_out REAL := 20;
  BEGIN
    -- I already removed that part for bug fixing and return a constant value (20)
    RETURN some_value_out;
  END;
$BODY$
  LANGUAGE plpgsql VOLATILE;

推荐答案

使用它来诊断您的问题:

Use this to diagnose your problem:

SELECT n.nspname AS schema, p.proname AS function
     , pg_get_function_identity_arguments(p.oid) As args
FROM   pg_proc p
JOIN   pg_namespace n ON n.oid = p.pronamespace
WHERE  p.proname LIKE 'calculate%';

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆