Skip to content

Latest commit

 

History

History
48 lines (35 loc) · 1.35 KB

File metadata and controls

48 lines (35 loc) · 1.35 KB

Load energy consumption data

When you have your database set up, you can load the energy consumption data into the metrics hypertable.

This is a large dataset, so it might take a long time, depending on your network connection.
  1. Download the dataset:
[metrics.csv.gz](https://assets.timescale.com/docs/downloads/metrics.csv.gz)
  1. Use your file manager to decompress the downloaded dataset, and take a note of the path to the metrics.csv file.

  2. At the psql prompt, copy the data from the metrics.csv file into your hypertable. Make sure you point to the correct path, if it is not in your current working directory:

    \COPY metrics FROM metrics.csv CSV;
  3. You can check that the data has been copied successfully with this command:

    SELECT * FROM metrics LIMIT 5;

    You should get five records that look like this:

             created            | type_id | value 
    -------------------------------+---------+-------
     2023-05-31 23:59:59.043264+00 |      13 |  1.78
     2023-05-31 23:59:59.042673+00 |       2 |   126
     2023-05-31 23:59:59.042667+00 |      11 |  1.79
     2023-05-31 23:59:59.042623+00 |      23 | 0.408
     2023-05-31 23:59:59.042603+00 |      12 |  0.96