POSTGRES:字符串被转换为未知

时间:2017-03-23 12:17:07

标签: linux postgresql psql postgresql-9.4

我有两个功能:

首先

CREATE OR REPLACE FUNCTION parking_main_analysis(park_id_p text, zone_parameter integer, org_id integer, number_of_days integer, timestamp_down timestamp with time zone, timestamp_up timestamp with time zone) RETURNS TABLE(total_occupancy integer, occupancy_ratio integer, entry_count integer, exit_count integer, movement_index float4, parking_short_1h integer, parking_short_1_2h integer, parking_mid_2_4h integer, parking_mid_4_6h integer, parking_long_6h_more integer) AS 
'
  DECLARE
    bla bla bla..not important..it has about 300 lines..
  END;
' LANGUAGE 'plpgsql';

第二

CREATE OR REPLACE FUNCTION parking_daily_snapshot(park_id_p text, time_interval integer, zone_parameter integer, org_id_p integer, article_id_p integer, article_class integer, validation integer, number_of_days integer, timestamp_down timestamp with time zone, timestamp_up timestamp with time zone)
 RETURNS TABLE(total_occupancy integer, occupancy_ratio integer, entry_count integer, exit_count integer, movement_index real, parking_short_1h integer, parking_short_1_2h integer, parking_mid_2_4h integer, parking_mid_4_6h integer, parking_long_6h_more integer)
 LANGUAGE plpgsql
AS $function$
  DECLARE
    bla bla bal..not important..it has about 300 lines..
  END;
$function$

它们都被加载到名为“report”的同一postgres 9.4.9数据库中。虽然第一个函数按预期工作,但第二个函数抛出异常:

report=# SELECT * FROM parking_daily_snapshot('d1faf5c6-ba85-4835-be2e-db434894cd64', 60, 999, 0, 0, 0, 1, '2017-03-22', '2017-03-22 23:59:59');
ERROR:  function parking_daily_snapshot(unknown, integer, integer, integer, integer, integer, integer, unknown, unknown) does not exist
LINE 1: SELECT * FROM parking_daily_snapshot('d1faf5c6-ba85-4835-be2...
                  ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
report=#

功能存在,我已经检查了两次。它的定义也是正确的。

但由于某种原因,它没有将字符串转换为字符串/日期时间。我几乎可以肯定这是因为一些错误,但我不知道它是在哪里制作的。该功能有大约300行,我已经检查了2次。

请问有谁知道这里发生了什么?

0 个答案:

没有答案