Is it possible to dump from Timescale without hypertable insertions?

Viewed 1369

I followed the manual on: https://docs.timescale.com/v1.0/using-timescaledb/backup

When I dump it into a binary file everything work out as expected (can restore it easily).

However, when I dump it into plain text SQL, insertions to hyper tables will be created. Is that possible to create INSERTION to the table itself?

Say I have an 'Auto' table with columns of id,brand,speed and with only one row: 1,Opel,170

dumping into SQL will result like this:

INSERT INTO _timescaledb_catalog.hypertable VALUES ...
INSERT INTO _timescaledb_internal._hyper_382_8930_chunk VALUES (1, 'Opel',170);

What I need is this (and let TS do the work in the background):

INSERT INTO Auto VALUES (1,'Opel',170);

Is that possible somehow? (I know I can exclude tables from pg_dump but that wouldn't create the needed insertion)

1 Answers

Beatrice. Unfortunately, pg_dump will dump commands that mirror the underlying implementation of Timescale. For example, _hyper_382_8930_chunk is a chunk underlying the auto hypertable that you have.

Might I ask why you don't want pg_dump to behave this way? The SQL file that Postgres creates on a dump is intended to be used by pg_restore. So as long as you dump and restore and see correct state, there is no problem with dump/restore.

Perhaps you are asking a different question?

Related