This function writes time series object into a relational PostgreSQL database make use of PostgreSQL own 'key'=>'value' storage called hstore. The schema and database needs to created first. The parent R Package of this functions suggests a database structure designed to store a larger amount of time series. This function uses INSERT INTO instead of the more convenient dbWritetable for performance reasons. DO NOT USE THIS FUNCTIONS IN LOOPS OR LAPPLY! This function can handle a set of time series on it's own and is much faster than looping over a list. Non-unique primary keys are overwritten !
storeTimeSeries(series, con, li = NULL, tbl = "timeseries_main",
md_unlocal = "meta_data_unlocalized", lookup_env = .GlobalEnv,
overwrite = T, schema = "timeseries")
character name of a time series, S3 class ts. When used with lists it is convenient to set series to names(li). Note that the series name needs to be unique in the database!
a PostgreSQL connection object.
list of time series. Defaults to NULL to no break legacy calls that use lookup environments.
character string denoting the name of the main time series table in the PostgreSQL database.
character string denoting the name of the table that holds unlocalized meta information.
environment to look in for timeseries. Defaults to .GobalEnv.
logical should existing records (same primary key) be overwritten? Defaults to TRUE.
SQL schema name. Defaults to timeseries.