From ba53fe5bfcac6ecc2f7fe6fc36514aed2046a4d4 Mon Sep 17 00:00:00 2001 From: Dusan Vojacek Date: Mon, 4 May 2026 19:10:15 +0200 Subject: [PATCH 1/2] fix --- db/routines/R__063_fn_load_planning_slots_full.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/db/routines/R__063_fn_load_planning_slots_full.sql b/db/routines/R__063_fn_load_planning_slots_full.sql index aee9aa4..bea8fb7 100644 --- a/db/routines/R__063_fn_load_planning_slots_full.sql +++ b/db/routines/R__063_fn_load_planning_slots_full.sql @@ -1,4 +1,7 @@ -- sloty pro LP: ceny, forecast, baseline, EV připojení + masky allow_charge / allow_discharge_export +-- DROP: změna RETURNS TABLE (nové sloupce) — CREATE OR REPLACE na rozdílný row type v PG neprojde. + +drop function if exists ems.fn_load_planning_slots_full; create or replace function ems.fn_load_planning_slots_full( p_site_id int, @@ -498,7 +501,7 @@ begin end; $fn$; -comment on function ems.fn_load_planning_slots_full(int, timestamptz, timestamptz, numeric) is +comment on function ems.fn_load_planning_slots_full is '15min sloty s cenami, forecastem, baseline a maskami proti mikro-cyklu (charge/discharge-export). ' 'Masky charge/discharge-export se berou zvlášť pro 00–12 a 12–24 Europe/Prague (polovina budgetu na segment). ' 'Strop SoC pro výpočet energie k dobití: coalesce(planner_max_soc_percent, max_soc_percent). ' From 6471467bc5b60a010925ee3500e90e7d83f79bd4 Mon Sep 17 00:00:00 2001 From: Dusan Vojacek Date: Mon, 4 May 2026 19:14:52 +0200 Subject: [PATCH 2/2] fix --- db/routines/R__063_fn_load_planning_slots_full.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/db/routines/R__063_fn_load_planning_slots_full.sql b/db/routines/R__063_fn_load_planning_slots_full.sql index bea8fb7..eabce9a 100644 --- a/db/routines/R__063_fn_load_planning_slots_full.sql +++ b/db/routines/R__063_fn_load_planning_slots_full.sql @@ -1,7 +1,10 @@ -- sloty pro LP: ceny, forecast, baseline, EV připojení + masky allow_charge / allow_discharge_export -- DROP: změna RETURNS TABLE (nové sloupce) — CREATE OR REPLACE na rozdílný row type v PG neprojde. +-- Musí být plná signatura (pg_proc ukládá int jako integer); DROP bez () funkci se směrem nemaže. -drop function if exists ems.fn_load_planning_slots_full; +drop function if exists ems.fn_load_planning_slots_full( + integer, timestamp with time zone, timestamp with time zone, numeric +); create or replace function ems.fn_load_planning_slots_full( p_site_id int,