HomeMogDBMogDB StackUqbar

Documentation:v1.1

Supported Versions:

Single-Field and Multi-Field Models

Uqbar supports single-field and multi-field write. Single-field model indicates that there is only one column that is neither TSTIME nor TSTAG during time-series table creation. Multi-field model indicates that there are multiple columns that are neither TSTIME nor TSTAG during time-series table creation.

Syntax Format

The INSERT and COPY syntaxes are supported.

INSERT INTO table_name[(targelist)]  VALUES(value_list)[, (value_list)]...;
COPY table_name [ ( column_name [, ...] ) ] 
    FROM { 'filename' | STDIN }
    [ [ USING ] DELIMITERS 'delimiters' ]
    [ WITHOUT ESCAPING ]
    [ LOG ERRORS ]
    [ REJECT LIMIT 'limit' ]
    [ WITH ( option [, ...] ) ]
    | copy_option
    | TRANSFORM  ( { column_name [ data_type ] [ AS transform_expr ] } [, ...] )
    | FIXED FORMATTER ( { column_name( offset, length ) } [, ...] ) [ ( option [, ...] ) | copy_option [  ...] ] ];

Examples

  • Create a single-field model table and insert data into the table.

    MogDB=# CREATE TIMESERIES TABLE weather(time timestamp TSTIME, city text TSTAG, location text TSTAG, temperature float) POLICY default_policy;
    CREATE TIMESERIES TABLE
    MogDB=# INSERT INTO weather VALUES('2022-06-18 00:00:00', 'beijing', 'park', 36);
    INSERT 0 1
  • Create a multi-field model table and insert data into the table.

    MogDB=# CREATE TIMESERIES TABLE weather(time timestamp TSTIME, city text TSTAG, location text TSTAG, temperature float, humidity float) POLICY default_policy;
    CREATE TIMESERIES TABLE
    MogDB=# INSERT INTO weather VALUES('2022-06-18 00:00:00', 'beijing', 'park', 36, 2.1);
    INSERT 0 1
Copyright © 2011-2024 www.enmotech.com All rights reserved.