Dump commands

// Quick Parameter Replacer (Updates PostgreSQL commands below in real-time)
IP / Host:   User:   Database:

Recommended: Dump database

pg_dump

pg_dump -h [IP] -U [User] -d [Database name] -Flag

what i use

pg_dump -h [IP] -U [User] -d [db-name] \
 -Fc -v \
 --include-extension \
 -f name_$(date +%Y%m%d).dump

in some case about postGis

pg_dump -h [IP] -U [User] -d [db-name] \
 -Fc -v \
 --exclude-table=spatial_ref_sys \
 --exclude-table=geography_columns \
 --exclude-table=geometry_columns \
 -f name_$(date +%Y%m%d).dump

Edit

Flag Objective
-Fc Custom format (compression)
-f Result file name
-v Verbose (show log)
--schema-only Dump only the schema, no data
--data-only Dump only the data, no schema
--exclude-table=[name] Skip table
--no-privileges Do not dump privileges (GRANT/REVOKE)
--no-owner Do not dump object ownership
Postgres-Restore

.mymoonnote