-
Notifications
You must be signed in to change notification settings - Fork 88
Adding filtering flag to pgcopydb dump schema #836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The style checker test is failing but I'm not sure why, it seems to be a problem in GitHub Actions itself? The docs test reports that you missed updated the docs command line options:
|
7c39556
to
39bb925
Compare
@dimitri Fixed it. I didn't aware there is an automated way to update CLI flag changes to the docs. Neat! |
39bb925
to
b9013de
Compare
@dimitri I don't understand why the style checker fails now. I tried on my dev machine using the same docker image used on the Github Actions, it worked. |
docs/include/dump-schema.rst
Outdated
--source Postgres URI to the source database | ||
--target Directory where to save the dump files | ||
--dir Work directory to use | ||
--skip-extensions Skip restoring extensions | ||
--filters <filename> Use the filters defined in <filename> | ||
--snapshot Use snapshot obtained with pg_export_snapshot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alignment issues. I suppose you have a mix of TAB and SPC characters in the source code strings, can you fix that and use only spaces?
src/bin/pgcopydb/cli_dump.c
Outdated
" --source Postgres URI to the source database\n" | ||
" --target Directory where to save the dump files\n" | ||
" --dir Work directory to use\n" | ||
" --skip-extensions Skip restoring extensions\n" \ | ||
" --snapshot Use snapshot obtained with pg_export_snapshot\n", | ||
" --source Postgres URI to the source database\n" | ||
" --target Directory where to save the dump files\n" | ||
" --dir Work directory to use\n" | ||
" --skip-extensions Skip restoring extensions\n" \ | ||
" --filters <filename> Use the filters defined in <filename>\n" | ||
" --snapshot Use snapshot obtained with pg_export_snapshot\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's here: use only spaces please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dimitri I had used make update-docs
to update the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alignment issue is with using TABs in the code instead of using only spaces.
Same conclusions here. I will be able to merge this one and we'll fix the GitHub actions later. |
The style checker GH action is broken. |
src/bin/pgcopydb/cli_dump.c
Outdated
" --source Postgres URI to the source database\n" | ||
" --target Directory where to save the dump files\n" | ||
" --dir Work directory to use\n" | ||
" --skip-extensions Skip restoring extensions\n" \ | ||
" --snapshot Use snapshot obtained with pg_export_snapshot\n", | ||
" --source Postgres URI to the source database\n" | ||
" --target Directory where to save the dump files\n" | ||
" --dir Work directory to use\n" | ||
" --skip-extensions Skip restoring extensions\n" \ | ||
" --filters <filename> Use the filters defined in <filename>\n" | ||
" --snapshot Use snapshot obtained with pg_export_snapshot\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alignment issue is with using TABs in the code instead of using only spaces.
@hanefi fixed it meanwhile! |
Following error will be seen without this fix, ``` 10:46:09.943 284145 INFO Running pgcopydb version 0.0.21.184.g8c85cce from "/home/ubuntu/dimitri/pgcopydb/src/bin/pgcopydb/pgcopydb" 10:46:09.981 284145 INFO Using work dir "/tmp/pgcopydb" 10:46:09.981 284145 INFO Restoring database from existing files at "/tmp/pgcopydb" 10:46:09.984 284145 INFO Current filtering setup is: {"type":"SOURCE_FILTER_TYPE_EXCL","exclude-table-data":[{"schema":"public","name":"metrics_New"}]} 10:46:09.984 284145 INFO Catalog filtering setup is: {"type":"SOURCE_FILTER_TYPE_NONE"} 10:46:09.984 284145 ERROR Catalogs at "/tmp/pgcopydb/schema/source.db" have been setup for a different filtering than the current command, see above for details 10:46:09.984 284145 ERROR Failed to initialize pgcopydb internal catalogs ``` The problem is, `pgcopydb dump schema` without filtering creates catalog with filtering type as NONE, when we supply filter for restore, it fails with filter type mismatch. Signed-off-by: Arunprasad Rajkumar <ar.arunprasad@gmail.com>
4b902ad
to
397b40a
Compare
Following error will be seen without this fix, ``` 10:46:09.943 284145 INFO Running pgcopydb version 0.0.21.184.g8c85cce from "/home/ubuntu/dimitri/pgcopydb/src/bin/pgcopydb/pgcopydb" 10:46:09.981 284145 INFO Using work dir "/tmp/pgcopydb" 10:46:09.981 284145 INFO Restoring database from existing files at "/tmp/pgcopydb" 10:46:09.984 284145 INFO Current filtering setup is: {"type":"SOURCE_FILTER_TYPE_EXCL","exclude-table-data":[{"schema":"public","name":"metrics_New"}]} 10:46:09.984 284145 INFO Catalog filtering setup is: {"type":"SOURCE_FILTER_TYPE_NONE"} 10:46:09.984 284145 ERROR Catalogs at "/tmp/pgcopydb/schema/source.db" have been setup for a different filtering than the current command, see above for details 10:46:09.984 284145 ERROR Failed to initialize pgcopydb internal catalogs ``` The problem is, `pgcopydb dump schema` without filtering creates catalog with filtering type as NONE, when we supply filter for restore, it fails with filter type mismatch. Signed-off-by: Arunprasad Rajkumar <ar.arunprasad@gmail.com>
Following error will be seen without this fix,
The problem is,
pgcopydb dump schema
without filtering creates catalog with filtering type as NONE, when we supply filter for restore, it fails with filter type mismatch.