RRules (yes handling RSCALE) using only PL/pgSQL