Thursday, 8 April 2021

Backing up one table with pg_dump (Windows)

 Navigate to the Postgres bin folder

cd "c:\Program Files\PostgreSQL\11\bin" 
Enter the pg_dump command
pg_dump -U postgres -W -F c -d ndlopfu -t transactions > c:\my_backups\ndlopfu_transactions.backup 

The options are as follows:

-U postgres: Use the user postgres

-W: Prompt for password

-F: Specifies the format. There are four options:

c: custom

d: directory 

t: tar

p: plain

-d ndlopfu: The database name

-t transactions: The table name

c:\my_backups\ndlopfu.backup: The backup path and filename 

No comments:

Post a Comment