Update upsert.sql

Extended upsert functionality to other timeseriesdb tables