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

pg:pull with --exclude-table-data does not work on Windows #1986

Open
rodxavier opened this issue Apr 19, 2022 · 2 comments · Fixed by #1987
Open

pg:pull with --exclude-table-data does not work on Windows #1986

rodxavier opened this issue Apr 19, 2022 · 2 comments · Fixed by #1987

Comments

@rodxavier
Copy link

rodxavier commented Apr 19, 2022

Do you want to request a feature or report a bug?

This is a bug report for Windows. This same command works as expected on Mac.

Heroku Version: heroku/7.60.1 win32-x64 node-v14.19.0
OS: Windows 10 OS Build(19044.1645)

This bug happens due to the generation of the pg_dump child process args. The resulting child process call for windows looks something like:

C:\WINDOWS\system32\cmd.exe /d /s /c "pg_dump --verbose -F c -Z 0 -N _heroku -U <user> -h localhost -p <port> <dbname> --exclude-table-data=table1 --exclude-table-data=table2'

It looks like pg_dump on Windows expects the dbname to be the last part of the command.

What is the current behavior?

Running heroku pg:pull --exclude-table-data "table1;table2" results in an error with pg_dump.

pg_dump: error too many command-line arguments first is "--exclude-table-data=table1"

What is the expected behavior?

Expected behaviour is to pull the database without data from the specified tables

@shaunkh
Copy link

shaunkh commented Aug 17, 2022

@rodxavier any idea on how you solved this?

@rodxavier
Copy link
Author

@shaunkh, please look at linked PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants