The SECURITY DEFINER functions do not have access to tables that are stored via dbWriteTable. Usage rights on these tables must be granted for them to be usable inside the db functions
db_grant_to_admin(con, table, schema = "timeseries")
RPostgres connection object.
which table to grant rights on
character name of the database schema. Defaults to 'timeseries'