*8763* fix Postgres SQL for timed views upgrade