pg_dump --help
pg_dump dumps a database as a text file.
Usage:
pg_dump [options] dbname
Options:
-a dump out only the data, no schema
-b dump out blob data
-c clean (drop) schema prior to create
-C output commands to create database
-d dump data as INSERT, rather than COPY, commands
-D dump data as INSERT commands with attribute names
-f FILENAME specify output file name
-F {c|t|p} output file format (custom, tar, plain text)
-h HOSTNAME server host name
-i proceed when database version != pg_dump version
-n suppress most quotes around identifiers
-N enable most quotes around identifiers
-o dump object ids (oids)
-O do not output \connect commands in plain text
format
-p PORT server port number
-R disable ALL reconnections to the database in
plain text format
-s dump out only the schema, no data
-S NAME specify the superuser user name to use in plain
text format
-t TABLE dump for this table only (* for all)
-u use password authentication
-v verbose
-x do not dump ACL's (grant/revoke)
-Z {0-9} compression level for compressed formats
If no database name is not supplied, then the PGDATABASE environment
variable value is used.
-- script 파일로 백업 받는다.
pg_dump -f [파일명] -d -u [DB Name]