How to run pg_dump/pg_dumpall command on Linux?

19,776

Such kind of questions are better to ask on ServerFault. You have to provide pg_dump with the valid postgresql account via command line parameter:

pg_dump -U postgres nsdgpkidb > file.sql

By default it assumes the current local user account (root). Another way is to change the current user and issue the command.

Share:
19,776
Vivek Kumar Ray
Author by

Vivek Kumar Ray

◊ 5 years 6 months of experience in Health Care, Telecom & E-governance domain with responsibilities Developer, and Implementation of Turnkey solutions for clients. ◊ Proficient in Java /J2EE, webservice, cloud and Bigdata Technologies. ◊ Experience in Agile and water fall model mythology ◊ Good analytical, troubleshooting and problem solving skills. ◊ Well versed with ISO-27001 standards for information security. ◊ Involved in client calls and conferences.

Updated on June 28, 2022

Comments

  • Vivek Kumar Ray
    Vivek Kumar Ray almost 2 years

    Hello everyone i am try to create backup in postgres through dump. when i run the command through command line it wants password when i give the password it will give some error

    pg_dump: [archiver (db)] connection to database "nsdgpkidb" failed: FATAL:  password authentication failed for user "root" 
    

    if any one have some valuable time please help me thanks.