Options allow you to specify combinations such as (I) only the definition of the table (2) only the data in the table (3) both the table definition and the data.
In the text format backup file, SQL statements such as CREATE TABLE, GRANT, COPY are used.
To restore from a backup file created with pg_dump, use the pg_restore command regardless of file format.
※This sample exam is different from those that appear in the actual OSS-DB Exam.
2019/05/30
pg_dump is a command used when PostgreSQL gets a database backup.
For one database in the database cluster, you can get backups of all or some tables. To back up the entire database cluster with a single command, use the command pg_dumpall.
By default, both table definitions and data are backed up, but with -s or --schema-only options only table definitions are backed up. Also, if you specify -a or --data-only option, only the data is backed up.
The format of the backup file is specified with the -F or --format option. The default is text format, but you can explicitly specify it as p or plain. The binary format specifies c (custom) in compressed archive format, d (directory) in directory format, t (tar) in TAR as an option.
The directory format is an option added in PostgreSQL 9.1.
The text format backup is SQL, which describes CREATE TABLE that defines the table, GRANT to grant access authority, COPY to put data in the table, and so on.
When restoring from backup, use psql command for text format backup. For binary backups, use the pg_restore command in either custom / directory / tar format.
Because it is a matter of choosing what is wrong, the correct answer is E.