PutElem 函数在提供的行类型中指示的时间点将元素添加到时间系列。
PutElem(ts TimeSeries, row_value row, flags integer default 0) returns TimeSeries;
如果时间戳记是 NULL,数据会追加到时间系列(对于常规时间系列),或者发生错误(对于非常规时间系列)。
对于常规时间系列,如果给定时间点存在数据,会更新为新数据;否则,会插入新数据。
传入的行类型必须符合时间系列的子类型。
无法更新隐藏的元素。
PutElem 的 API 等效项是 ts_put_elem()。
包含新值的修改的时间系列。
update daily_stocks set stock_data = PutElem(stock_data, row(NULL::datetime year to fraction(5), 2.3, 3.4, 5.6, 67)::stock_bar) where stock_name = 'GBase';
update activity_stocks set activity_data = PutElem(activity_data, row('2011-08-25 09:06:00.00000', 6.25, 1000, 1, 007, 2, 1)::stock_trade) where stock_id = 600;