Created
August 19, 2020 18:16
-
-
Save tylerfontaine/153f9030e611d97cef5bb02ed3809e2c to your computer and use it in GitHub Desktop.
Copy Table(s) from one database to another
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOAD DATABASE | |
FROM postgresql://postgres:password@localhost/postgres | |
INTO postgresql://postgres:password@localhost/testdb-copy | |
WITH include drop, create tables, schema only | |
including only table names matching 'test' in schema 'public' | |
AFTER LOAD DO | |
$$ SELECT create_hypertable('test', 'time') $$ ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOAD DATABASE | |
FROM postgresql://postgres:password@localhost/postgres | |
INTO postgresql://postgres:password@localhost/testdb-copy | |
WITH data only | |
including only table names matching 'test' in schema 'public'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment