fix sqlradacct calculations for old Pg