PostgreSQL – Repair Application Binaries

Background

Working from the console and not careful, it is not so hard to make stupid mistakes.

Scenario

Yesterday while trying to export and import files, I made a freshman mistake.

To export data, I issued this command

pg_dumpall > datafile

Conversely, to import data, issued this command

pg_dumpall < datafile

Significance

Directing datafile to pg_dumpall ended up wiping out my copy of pg_dumpall.

Impacted File

Impacted File – pg_dumpall.exe

Image

version11.pg_dumpall.exe.01.20191020.1040PM

Listing

  1. File Name :- pg_dumpall.exe
  2. File Date :- 2019-10-18 10:28 PM
  3. File Size :- 0

 

Remediation

Outline

  1. Artifacts
    • Identify download locations
    • Download artifacts
  2. Replace Corrupted file
    • Backup Corrupted file
    • Replace Corrupted file with downloaded One

Artifacts

Identify Download Locations

Here are websites that avail the artifacts :-

  1. Enterprise DB ( EDB ) Postgres

Available Artifacts

Image

enterprisedb.com.artifacts.20191020.1028PM

Listing

  1. Version 12
    • Version 12.0
  2. Version 11
    • Version 11.5
  3. Version 10
    • Version 10.10
  4. Version 9
    • Version 9.6.15
    • Version 9.5.19
    • Version 9.4.24

 

Replace Corrupted File

Backup Corrupted File

Sample


mkdir backup\20191020.1049PM
xcopy pg_dumpall.exe backup\20191020.1049PM

Output

version11.pg_dumpall.exe.copy.01.20191020.1053PM

Backup Corrupted File

Sample


mkdir backup\20191020.1049PM
xcopy pg_dumpall.exe backup\20191020.1049PM

Output

version11.pg_dumpall.exe.copy.01.20191020.1053PM

Replace Corrupted file with downloaded One

Sample


xcopy C:\downloads\postgresql\v11.5.2\extract\pgsql\bin\pg_dumpall.exe "C:\Program Files\PostgreSQL\11\bin" /Y

Output

version11.pg_dumpall.exe.copy.02.20191020.1059PM

Summary

Here is a saying a lot when fewer words would have been sufficient.

If you are working closer to the pedal than your ability or present awareness, please reach for the corresponding binaries and replace the downtrodden ones.

 

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s