Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Add support for schema-only dump/restore #7

Open
davidkohn88 opened this issue May 21, 2020 · 2 comments
Open

Add support for schema-only dump/restore #7

davidkohn88 opened this issue May 21, 2020 · 2 comments

Comments

@davidkohn88
Copy link
Contributor

In order to do a schema only dump/restore we need to a) do a schema only dump of everything b) do a dump of the timescale catalog which we'll need to restore

schema only restores can happen either from a schema only dump or not, but they need to restore the catalog schema as well.

@tylerfontaine
Copy link
Contributor

In doing some testing with pg_dump, I think you can exclude the entire _timescaledb_* schema pattern, since these are re-created when the extension gets installed. The tables, then, are re-created. But they need select create_hypertable re-run on them. This would reduce what gets stored, since we wouldn't need to store and restore all the individual chunk schemas.

This also doesn't migrate caggs, jobs, etc. So these would all need to be extracted by the tool and re-created as well. This is hard to do with just pg_dump and pg_restore, though.

It's very likely this might require more than just calling pg_dump / pg_restore, though, so perhaps there's a more surgical way to dump/restore the catalog data in a way that leaves you with ready, but empty hypertables without also having a bunch of empty chunks pre-created.

@davidkohn88
Copy link
Contributor Author

There's also a good way of doing this that would eliminate all the current chunks of a table by excluding all the tables in the chunk catalog and then doing a schema only dump and then dumping/restoring the catalogs other than the chunk, this would mean that you get an "empty" hypertable and would limit the amount of locking etc on restore which can still take a long time if you're not careful.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants