-n schema
--schema=schema
Dump only schemas matching schema; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. Also, the schema parameter is interpreted as a pattern according to the same rules used by psql's \d commands (see Patterns), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples.

Note: When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database.

Note: Non-schema objects such as blobs are not dumped when -n is specified. You can add blobs back to the dump with the --blobs switch.

-N schema
--exclude-schema=schema
Do not dump any schemas matching the schema pattern. The pattern is interpreted according to the same rules as for -n. -N can be given more than once to exclude schemas matching any of several patterns.

When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n, then schemas matching -N are excluded from what is otherwise a normal dump.

[링크 : https://www.postgresql.org/docs/9.1/app-pgdump.html]

[링크 : https://stackoverflow.com/questions/14486241/how-can-i-export-the-schema-of-a-database-in-postgresql]

[링크 : https://dba.stackexchange.com/questions/53185/postgresql-how-to-backup-only-one-schema-from-a-database-and-restore-it-on-anot]

 

'프로그램 사용 > postgreSQL' 카테고리의 다른 글

sql에서 null 비교  (0) 2020.02.07
ER 다이어그램 식별 / 비식별  (0) 2020.02.07
drop database와 postgres  (0) 2020.02.04
union / intersect / minus  (0) 2020.01.22
one to one , one to only one  (0) 2020.01.17
Posted by 구차니