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

Error: Nonexistent flags #52

Open
nsaud01 opened this issue Sep 29, 2023 · 2 comments
Open

Error: Nonexistent flags #52

nsaud01 opened this issue Sep 29, 2023 · 2 comments

Comments

@nsaud01
Copy link

nsaud01 commented Sep 29, 2023

This command was working great until fairly recently

npx pg-anonymizer postgres://"${PROD_POSTGRES_USER}":"${PROD_POSTGRES_PASSWORD}"@"${PROD_POSTGRES_HOST}":5432/"${PROD_POSTGRES_DB}" --no-privileges --no-owner --clean --if-exists -T "Changelog"

This has been failing with the following error:
› Error: Nonexistent flags: --no-privileges, --no-owner, --clean, › --if-exists, -T, -T, -T › See more help with --help

Have the ability to add pgdump flags been removed?

Thanks!

@Eyjafjallajokull
Copy link

No, you need to separate pg-anonymizer arguments from pg_dump arguments with --, e.g.:

npx pg-anonymizer postgres://"${PROD_POSTGRES_USER}":"${PROD_POSTGRES_PASSWORD}"@"${PROD_POSTGRES_HOST}":5432/"${PROD_POSTGRES_DB}" -- --no-privileges --no-owner --clean --if-exists -T "Changelog"

@Lelandi
Copy link

Lelandi commented Jan 8, 2024

Greetings. Confirmed. Version 0.8.0 doesn't accept more than 1 "-T" command.
@Eyjafjallajokull this commmand for example: npx pg-anonymizer postgres://"${PROD_POSTGRES_USER}":"${PROD_POSTGRES_PASSWORD}"@"${PROD_POSTGRES_HOST}":5432/"${PROD_POSTGRES_DB}" -- --no-privileges --no-owner --clean --if-exists -T "Changelog" -T "AnotherTable"

Will return the error:

ls/pg-dump.js:14
        throw new errors_1.CLIError(`pg_dump command error: ${data.toString()}`);
        ^

CLIError: pg_dump command error: pg_dump: error: too many command-line arguments (first is "AnotherTable")
Try "pg_dump --help" for more information.

I'm using 0.7.0 (with some command changes and it's working flawlessly)

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

No branches or pull requests

3 participants