Skip to content

fix: ensures dbname is always the last arg provided to pg_dump - #3979

Merged
tlowrimore-heroku merged 7 commits into
mainfrom
fix/exclude-table-data-win
Oct 9, 2026
Merged

tlowrimore-heroku merged 7 commits into
mainfrom
fix/exclude-table-data-win

Conversation

@tlowrimore-heroku

@tlowrimore-heroku tlowrimore-heroku commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Addresses an issue originally reported in April of 2022, where the arguments being provided to pg_dump were not in the correct order (database name should be the last argument). This was not a problem on MacOS and Linux, but it resulted in an error, when run on Windows.

The originally proposed solution was to simple prepend the --exclude-table-data flag to the flags array. Our solution takes a different approach. Rather than expanding the connection arguments into the flags array, and only pushing additional flags onto the head of the array, the connection arguments are concatenated with the flags just before spawning the child command, within which pg_dump is executed. This allows for flags to be either prepended or appended to the flags array. By concatenating the connection args onto the flags array, we can guarantee connection args are always at the end of the args sent to pg_dump. This approach also ensures the flags array only contains flags.

Type of Change

Breaking Changes (major semver update)

  • Add a ! after your change type to denote a change that breaks current behavior

Feature Additions (minor semver update)

  • feat: Introduces a new feature to the codebase

Patch Updates (patch semver update)

  • fix: Bug fix
  • deps: Dependency upgrade
  • revert: Revert a previous commit
  • chore: Change that does not affect production code
  • refactor: Refactoring existing code without changing behavior
  • test: Add/update/remove tests

Testing

  • CI should pass for all operating systems
  • invoke pg:push and pg:pull on Windows, using the --exclude-table-data flag.

Screenshots

Tested on Windows

1. Verified the records in the remote (Heroku) database
Screenshot 2026-10-09 at 5 05 25 PM
2. Ran heroku pg:pull in Windows
Screenshot 2026-10-09 at 5 06 06 PM
3. Verified the database was restored, excluding the records in ideas table
Screenshot 2026-10-09 at 5 04 24 PM

Related Issues

GitHub issue: #1986
GUS work item: W-16153699

@tlowrimore-heroku
tlowrimore-heroku requested a review from a team as a code owner October 8, 2026 20:25
@tlowrimore-heroku
tlowrimore-heroku deployed to AcceptanceTests October 8, 2026 20:25 — with GitHub Actions Active
@tlowrimore-heroku
tlowrimore-heroku deployed to AcceptanceTests October 8, 2026 20:25 — with GitHub Actions Active
@tlowrimore-heroku
tlowrimore-heroku deployed to AcceptanceTests October 8, 2026 20:25 — with GitHub Actions Active
@tlowrimore-heroku
tlowrimore-heroku deployed to AcceptanceTests October 8, 2026 20:25 — with GitHub Actions Active
@tlowrimore-heroku
tlowrimore-heroku marked this pull request as draft October 8, 2026 20:25
@github-actions github-actions Bot added the size/S Small PR (code churn < 100) label Oct 8, 2026
@tlowrimore-heroku
tlowrimore-heroku deployed to AcceptanceTests October 8, 2026 20:32 — with GitHub Actions Active
@tlowrimore-heroku
tlowrimore-heroku deployed to AcceptanceTests October 8, 2026 20:32 — with GitHub Actions Active
@tlowrimore-heroku
tlowrimore-heroku deployed to AcceptanceTests October 8, 2026 20:32 — with GitHub Actions Active
@tlowrimore-heroku
tlowrimore-heroku deployed to AcceptanceTests October 8, 2026 20:32 — with GitHub Actions Active
@github-actions github-actions Bot added size/M Medium PR (code churn < 500) and removed size/S Small PR (code churn < 100) labels Oct 8, 2026
@tlowrimore-heroku
tlowrimore-heroku deployed to AcceptanceTests October 8, 2026 20:49 — with GitHub Actions Active
@tlowrimore-heroku
tlowrimore-heroku marked this pull request as ready for review October 8, 2026 21:01

@jdodson jdodson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid fix.

Approved.

@tlowrimore-heroku
tlowrimore-heroku deployed to AcceptanceTests October 9, 2026 22:50 — with GitHub Actions Active
@tlowrimore-heroku
tlowrimore-heroku deployed to AcceptanceTests October 9, 2026 22:50 — with GitHub Actions Active
@tlowrimore-heroku
tlowrimore-heroku deployed to AcceptanceTests October 9, 2026 22:50 — with GitHub Actions Active
@tlowrimore-heroku
tlowrimore-heroku deployed to AcceptanceTests October 9, 2026 22:50 — with GitHub Actions Active
@tlowrimore-heroku
tlowrimore-heroku merged commit 70e5f2e into main Oct 9, 2026
22 checks passed
@tlowrimore-heroku
tlowrimore-heroku deleted the fix/exclude-table-data-win branch October 9, 2026 23:10

This branch was successfully deployed

1 active deployment
AcceptanceTests — 3c951f4c Deployed Oct 9, 2026 by tlowrimore-heroku via integration (20.x, ubuntu-latest) #9416
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Medium PR (code churn < 500)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants