You can migrate data into a Timescale hypertable from a regular PostgreSQL table. This method assumes that you have Timescale set up in the same database instance as your existing table.
Before beginning, make sure you have installed and set up Timescale.
You also need a table with existing data. In this example, the source table is
old_table. Replace the table name with your actual table name. The
example also names the destination table
new_table, but you might want to use
a more descriptive name.
Migrate your data into Timescale from within the same database.
Create a new table based on your existing table. You can create your indexes at the same time, so you don't have to recreate them manually. Or you can create the table without indexes, which makes data migration faster.With indexesWithout indexes
Convert the new table to a hypertable using the
tswith the name of the column that holds time values in your table.
by_rangedimension builder is an addition to TimescaleDB 2.13.
Insert data from the old table to the new table.
If you created your new table without indexes, recreate your indexes now.
Found an issue on this page?Report an issue!