Hi,

Scheduled tasks set as the last day of February this year did not work. In
your schedule function have a small bug.  Leap year function get year
parameter, but your code is sending day as a parameter.  Fixing patch
attached in this mail.

Best Regards...

-- 
MEHMET EMİN KARAKAŞ
PostgreSQL DBA

Turksat Satellite Communication and Cable TV Operations
Konya Yolu 40. Km. 06839 Golbasi / ANKARA - TÜRKİYE
Tel     :  +90 312 615 32 73
Faks  :  +90 312 615 32 77
diff --git a/sql/pgagent.sql b/sql/pgagent.sql
index 7eb42ba..7ff552b 100644
--- a/sql/pgagent.sql
+++ b/sql/pgagent.sql
@@ -476,7 +476,7 @@ BEGIN
             (jscmonthdays = ''{f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,t}'' AND
              ((date_part(''MONTH'', nextrun) IN (1,3,5,7,8,10,12) AND date_part(''DAY'', nextrun) = 31) OR
               (date_part(''MONTH'', nextrun) IN (4,6,9,11) AND date_part(''DAY'', nextrun) = 30) OR
-              (date_part(''MONTH'', nextrun) = 2 AND ((pgagent.pga_is_leap_year(date_part(''DAY'', nextrun)::int2) AND date_part(''DAY'', nextrun) = 29) OR date_part(''DAY'', nextrun) = 28))))) AND
+              (date_part(''MONTH'', nextrun) = 2 AND ((pgagent.pga_is_leap_year(date_part(''YEAR'', nextrun)::int2) AND date_part(''DAY'', nextrun) = 29) OR date_part(''DAY'', nextrun) = 28))))) AND
             (jscmonths = ''{f,f,f,f,f,f,f,f,f,f,f,f}'' OR jscmonths[date_part(''MONTH'', nextrun)] = TRUE)) THEN
 
 

Reply via email to