Does the `Replace` class re-create the hyptertable?
LawrentChen opened this issue · 3 comments
Hi, I am using pgcopy v1.5.0. Thank you for such a good tool.
But I am wondering if the Replace
class re-create the hypertable since I am using TimeScaleDB. As far as I can see, the record in _timescaledb_catalog.hypertable
will be deleted once the table has been replaced.
And if I use select create_hypertable(tablename, by_range('time'), migrate_data=>true);
, it seems to work fine. But that tablename would not appear in _timescaledb_catalog.hypertable
still. Has it converted into a hypertable, or not?
It seems to me that the Replace
class should build back an identical table, or does it still not support hyptertable in TimeScaleDB yet?(only normal table in postgres?)
Thank you.
Thank you @LawrentChen for your interest in this project! I am not familiar with hypertable or TimeScaleDB, I don’t expect that it is supported. Aside from the table itself, constraints, indices, triggers, and views are recreated. Due to naming restrictions, foreign-key and check constraints will not have the same name.
Thank you @altaurog for your kindly reply!
I find timescale/timescaledb#648. The way to check where an existing table is hypertable or not shoule be to query _timescaledb_catalog.hypertable
. As I mention above, pgcopy will delete the related record in _timescaledb_catalog.hypertable
. So I believe that pgcopy would not recreate the hypertable, for now.
To make things done, I thought it should be straight to use select create_hypertable(tablename, by_range('time'), migrate_data=>true);
after using replace. But, still, as I mention above, that tablename would not appear in _timescaledb_catalog.hypertable
again and I don't know why.
For now I will use pgcopy carefully with hypertable.
If you can add TimeScaleDB support it would be a lot of help. Sadly I am not good enough to make any solid contribution....That would be just a wish in list.
Feel free to close this issue. Thank you again!
Sorry I can’t be more help. TimeScaleDB seems interesting, but it is definitely out of scope for this project.