Skip to content
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

semicolon in ini file for exclude_tables #103

Closed
wants to merge 0 commits into from
Closed

semicolon in ini file for exclude_tables #103

wants to merge 0 commits into from

Conversation

pchovelon
Copy link
Contributor

@pchovelon pchovelon commented Sep 22, 2023

Issue related : #102

ini file understands ";" as comment in line. See : https://ini.unknwon.io/docs/howto/work_with_comments

therefore the function ini.Load() used in the file config.go

cfg, err := ini.Load(path) 

removes the second (and more) tables in the exclude_tables parameter.

With my change, ";" are taken in account when reading the ini file and all the tables mentionned are excluded by pg_dump.

cfg, err := ini.LoadSources(ini.LoadOptions{IgnoreInlineComment: true,},path)

For exemple :

exclude_tables = pgbench_accounts;pgbench_branches;pgbench_history

Only pgbench_tellers is in the dump as requester

216; 1259 16395 TABLE public pgbench_tellers postgres
3384; 0 16395 TABLE DATA public pgbench_tellers postgres

@pchovelon pchovelon changed the title Prise en compte des ; dans les listes semicolon in ini file for exclude_tables Sep 22, 2023
@orgrim
Copy link
Owner

orgrim commented Sep 23, 2023

Hi.

It looks like the feature just never worked, but people may have put inline comments in their configuration files. So I think it would be better to change the separator from semicolon to comma, which is already used for exclude_dbs.

It would allow to use the Strings() helper and remove the parseIdentifierList() function.

What do you think?

Regards

@pchovelon
Copy link
Contributor Author

Indeed, if commas are already used for exclude_dbs, we should keep them as separators.

@pchovelon
Copy link
Contributor Author

I changed the code to use String() function with the comma as separator.
Please ignore the deletion of pg_back.conf

@pchovelon pchovelon closed this Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants