Skip to content

Instantly share code, notes, and snippets.

View Locke-bot's full-sized avatar

Moses Locke-bot

  • Lagos, Nigeria
View GitHub Profile
@michaeltreat
michaeltreat / heroku_pg:push_workaround.md
Last active November 16, 2022 09:19
Quick workaround for pushing your local database to heroku for windows machines.

Workaround for pushing to heroku database on windows machince.

Context:

The command heroku pg:push essentially executes two commands under the hood. First, it executes pg_dump, which makes a backup file of a specific database. Then, it pipes that file into pg_restore, where it takes that dump file and uses it to restore another database. The way we usually use it is to push a local database to a deployed heroku database.

The problem is that on windows, the command breaks while trying to pipe in the backup file from pg_dump to pg_restore, so we need to do these two commands manually.

Solution: