command used to take backup
C:\Program Files\PostgreSQL\12\bin>pg_dump -h localhost -U postgres -p 5432 -Fc -f "D:\Database Backup\temp_10.bak" GESEMS_Performace_Test.
Error :
pg_dump: NOTICE: hypertable data are in the chunks, no data will be copied.
DETAIL: Data for hypertables are stored in the chunks of a hypertable so COPY TO of a hypertable will not copy any data.
Any suggestions to take backup of TimescaleDB hypertables?
In TimescaleDB, the hypertable is an empty table and the data is stored in child tables called chunks. You can see the structure of the hypertable using the
\d+
command inpsql
:When you dump a table using PostgreSQL
pg_dump
, it will dump the contents of the parent table and the child tables separately. When you restore the dump it will in turn fill both the hypertable (parent table) and the chunks (child tables).Since
pg_dump
uses the standardCOPY
command to extract the contents of tables when dumping, TimescaleDB prints a notice that you're trying to dump a hypertable, which is empty.The reasons for this is that if you do a direct dump of the hypertable only using
COPY
, it will not dump any data at all, which is useful to know since it's easy to make a mistake otherwise. Since it is not possible to distinguish between the case that you runCOPY
to on a single table directly and usingpg_dump
(which dumps all tables), this notice will be printed also when you usepg_dump
, but it is harmless.You should check the actual dump output to see that the child tables are actually dumped.