I am trying to take a backup of a TimescaleDB database, excluding two very big hypertables.
That means that while the backup is running, I would not expect to see any COPY
command of the underlying chunks, but I actually do!
Let's say TestDB
is my database and it has two big hypertables on schema mySchema
called hyper1
and hyper2
, as well as other normal tables.
I run the following command:
pg_dump -U user -F t TestDB --exclude-table "mySchema.hyper1" --exclude-table "mySchema.hyper2" > TestDB_Backup.tar
Then I check the running queries (esp. because I did not expect it to take this long) and I find out that several COPY commands are running, for each chunk of the tables I actually excluded.
This is TimescaleDB
version 1.7.4
.
Did this ever happen to any of you and what is actually going on here?
ps. I am sorry I cannot really provide a repro for this and that this is more of a discussion than an actual programmatic problem, but I still hope someone has seen this before and can show me what am I missing :)
pg_dump
are you using? Is it the one that came with TimeccaleDB? – Propagation--exclude-table/-T
to match multiple tables. See here Patterns. – Propagationpg_dump
. – PropagationCOPY
will only run for those tables thatpg_dump
thinks need to be outputted. If a table name matches the pattern it will not be outputted. – Propagation--exclude-table
if they match the pattern. So assuminghyper1
has child tables namedhyper1a, hyper1b, etc
the `--exclude-table hyper1*
will match them all. – PropagationmySchema
in your database? If so then you will need to do--exclude-table '"mySchema.hyper2"'
( single quotes enclosing double quotes) to preserve the case and have it match. – Propagation