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

问题描述

我尝试使此功能运行.当我使用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 existhint no function matches the given name and argument types(从德语翻译)

ERROR: function calculate_something(integer) doesn't existhint 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%';

09-05 10:08
查看更多