updated py scripts/interval for pgsql