I doubt the contention the statement runs in EnterpriseDB:
select count(*)
from cdar_cpms_owner.hshldgrp_wkly_actvty s
where s.wk_id between (extract(isoyear from now()-interval '9 week')
|| trim(to_char(extract(week from now()-interval '9 week'),'09')))::numeric
and s.wk_id > (extract(isoyear from now()-interval '2 week')
|| trim(to_char(extract(week from now()-interval '2 week'),'09')))::numeric;
If it does then EnterpriseDB has a serious issue as this statement doesn't make any sense. If you resolve the just the date manipulation using 19-Apr-2020 as the date you reduce the statement to:
select count(*)
from cdar_cpms_owner.hshldgrp_wkly_actvty s
where s.wk_id between 202007 and s.wk_id > 202014;
But presuming wk_id is a numeric the sub-expresion "s.wk_id > 202014" produces a boolean and the resulting where becomes:
where s.wk_id between a numeric and a boolean
And that IS or at least should be invalid. Perhaps the error was detected and corrected in one environment but not in the other.
Solution remove "s.wk_id >" from the AND phase of the between clause:
select count(*)
from cdar_cpms_owner.hshldgrp_wkly_actvty s
where s.wk_id between (extract(isoyear from now()-interval '9 week')
|| trim(to_char(extract(week from now()-interval '9 week'),'09')))::numeric
and (extract(isoyear from now()-interval '2 week')
|| trim(to_char(extract(week from now()-interval '2 week'),'09')))::numeric;
BTW getting the ISO Year and ISO week can be retrived directly with to_char having format 'iyyyiw'. So the query becomes (IMHO) cleaner more easily understood (although I admit the format initially looks strange):
select count(*)
from cdar_cpms_owner.hshldgrp_wkly_actvty s
where s.wk_id between to_char(now()-interval '9 week','iyyyiw')::numeric
and to_char(now()-interval '2 week','iyyyiw')::numeric;