我正在使用PostgreSQL上的表格返回函數(使用pgAdmin 4)。它曾經工作得很好,但由於某種原因,我得到試圖修改功能時,此錯誤消息:postgresql截斷字符串
ERROR: type "TABLE(id integer, id_scenario integer, date_valid timestamp wit" does not exist NOTICE: identifier "TABLE(id integer, id_scenario integer, date_valid timestamp without time zone, dni_q95 double precision, csp_forecast_q95 double precision, storage_q95 double precision)" will be truncated to "TABLE(id integer, id_scenario integer, date_valid timestamp wit"
我明白了一個標識符不能超過63個字節,所以我的代碼行被截斷。我會很感激,如果有人可以幫助我在這2個問題:
爲什麼這條線突然公認的標識?
如何解決這個問題,知道我需要返回所有這些列?
下面是函數體:
CREATE OR REPLACE FUNCTION public.csp_park_95(id_park integer)
RETURNS SETOF "TABLE(id integer, id_scenario integer, date_valid
timestamp without time zone, dni_q95 double precision, csp_forecast_q95
double precision, storage_q95 double precision)"
LANGUAGE 'sql'
COST 100.0
VOLATILE
ROWS 1000.0
AS $function$
-- irrelevant code
$function$;
ALTER FUNCTION public.csp_park_95(integer)
OWNER TO "POC_kacare_admin";
「*?爲什麼這條線突然公認的標識符」 *因爲雙引號是標識符:https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS –