Support for exclude table (-X) and exclude parent table (-Y) option#360
Support for exclude table (-X) and exclude parent table (-Y) option#360chanukyasds wants to merge 11 commits intoreorg:masterfrom
Conversation
…' into support-----exclude-table-option
|
I'm voting for not using short options for this feature, just the long ones. @za-arthur @Melkij What do you think? |
|
Personally, I don't use pg_repack without Yes, I agree that it is better to add only long options. It would be better to have the -T option for --exclude-table (the pg_dump analogy would be very handy), but that option was already taken. |
|
I agree -T is not available. I think it's a better idea that we all can discuss and re-arrange options with best analogy. Even I thought of below options for better understanding. -t --table --exclude-table --exclude-schema is a good option. I will work on that and create a pull soon. |
|
I agree that we probably want to add new short option names only if it is necessary and it is a good idea to add long names only for this PR. |
za-arthur
left a comment
There was a problem hiding this comment.
Generally the PR looks good to me as well. I have couple comments below.
In the addition to those comments I'd suggest you to add new tests to test new options.
| if (iparam < num_relations) | ||
| appendStringInfoChar(&sql, ','); | ||
| } | ||
| for (cell = exclude_table_list.head; cell; cell = cell->next) |
There was a problem hiding this comment.
This logic is probably unnecessary since exclude-table conflicts with table and parent-table:
https://github.com/reorg/pg_repack/pull/360/files#diff-a9d4d5b8968d339c50f089a6b531b1f36eedd27cdc008bdb26b70fb9fd0eee2fR377
There was a problem hiding this comment.
This logic helps pg_repack to find the exclude-table exists in the database or not.
I agree that exlude-table conflicts with table and parent-table options.
For example, consider below case.
pg_repack -p 5433 -d postgres -X test.table1
In above command user can skip a table from a database ,so we need to check the exclude-table (test.table1) existence.
some other examples:
pg_repack -p 5433 -d postgres -X test.table1 -X public.table_1
pg_repack -p 5433 -d postgres -X test.table1 -Y public.ptable2
| if (iparam < num_relations) | ||
| appendStringInfoChar(&sql, ','); | ||
| } | ||
| for (cell = exclude_parent_table_list.head; cell; cell = cell->next) |
There was a problem hiding this comment.
Same as above exclude-parent-table conflicts with table and parent-table:
https://github.com/reorg/pg_repack/pull/360/files#diff-a9d4d5b8968d339c50f089a6b531b1f36eedd27cdc008bdb26b70fb9fd0eee2fR382
There was a problem hiding this comment.
Same as above.
This logic helps pg_repack to find the exclude-parent-table exists in the database or not.
For example consider below case.
pg_repack -p 5433 -d postgres -Y public.ptable2
In above command user can skip a parent table from a database, so we need to check the exclude-parent-table (public.ptable2) existence.
|
I have removed short option names and provided long option names. --exclude-table Documentation is updated. |
Idea is to support pg_repack with below options
These options has been added to the documentation.
please suggest the options if needed. (-X) and (-Y) are free currently.
Once PR is merged, I will be writing the regression tests.
Related issues
#18
#234