francoisjacquet
The current version that we are using is v12.1.3 and is working very fine. I tried to install the v12.2 and I encountered so many errors when I run the program.
These are the errors below:
We have a problem, please contact technical support ...
03/25/2025 10:57:16
Date
DB Execute Failed. ERROR: must be owner of language plpgsql
Failure Notice
CREATE OR REPLACE LANGUAGE plpgsql;
--
-- Name: calc_gpa_mp(s_id integer, mp_id integer); Type: FUNCTION; Schema: public; Owner: postgres
--
-- @since 12.2 SQL N/A grade (empty GPA value) does not affect GPA
--
CREATE OR REPLACE FUNCTION calc_gpa_mp(s_id integer, mp_id integer) RETURNS integer AS $$
DECLARE
oldrec student_mp_stats%ROWTYPE;
BEGIN
SELECT * INTO oldrec FROM student_mp_stats WHERE student_id = s_id and marking_period_id = mp_id;
IF FOUND THEN
UPDATE student_mp_stats SET
sum_weighted_factors = rcg.sum_weighted_factors,
sum_unweighted_factors = rcg.sum_unweighted_factors,
cr_weighted_factors = rcg.cr_weighted,
cr_unweighted_factors = rcg.cr_unweighted,
gp_credits = rcg.gp_credits,
cr_credits = rcg.cr_credits
FROM (
select
sum(weighted_gpcredit_attempted/gp_scale) as sum_weighted_factors,
sum(unweighted_gpcredit_attempted/gp_scale) as sum_unweighted_factors,
sum(credit_attempted) as gp_credits,
sum( case when class_rank = 'Y' THEN weighted_gpcredit_attempted/gp_scale END ) as cr_weighted,
sum( case when class_rank = 'Y' THEN unweighted_gpcredit_attempted/gp_scale END ) as cr_unweighted,
sum( case when class_rank = 'Y' THEN credit_attempted END) as cr_credits
from student_report_card_grades where student_id = s_id
and marking_period_id = mp_id
and not gp_scale = 0
and weighted_gp is not null
group by student_id, marking_period_id
) as rcg
WHERE student_id = s_id and marking_period_id = mp_id;
RETURN 1;
ELSE
INSERT INTO student_mp_stats (student_id, marking_period_id, sum_weighted_factors, sum_unweighted_factors, grade_level_short, cr_weighted_factors, cr_unweighted_factors, gp_credits, cr_credits)
select
srcg.student_id,
srcg.marking_period_id,
sum(weighted_gpcredit_attempted/gp_scale) as sum_weighted_factors,
sum(unweighted_gpcredit_attempted/gp_scale) as sum_unweighted_factors,
(select eg.short_name
from enroll_grade eg, marking_periods mp
where eg.student_id = s_id
and eg.syear = mp.syear
and eg.school_id = mp.school_id
and eg.start_date <= mp.end_date
and mp.marking_period_id = mp_id
order by eg.start_date desc
limit 1) as short_name,
sum( case when class_rank = 'Y' THEN weighted_gpcredit_attempted/gp_scale END ) as cr_weighted,
sum( case when class_rank = 'Y' THEN unweighted_gpcredit_attempted/gp_scale END ) as cr_unweighted,
sum(credit_attempted) as gp_credits,
sum(case when class_rank = 'Y' THEN credit_attempted END) as cr_credits
from student_report_card_grades srcg
where srcg.student_id = s_id
and srcg.marking_period_id = mp_id
and not srcg.gp_scale = 0
and weighted_gp is not null
group by srcg.student_id, srcg.marking_period_id, short_name;
END IF;
RETURN 0;
END;
$$ LANGUAGE plpgsql;
SQL query