Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for pg_dump -n and -N flags #1148

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

digital2real
Copy link

--pg-namespace=PG-NAMESPACE
translate to -n, --schema=SCHEMA
dump the named schema(s) only

--pg-exclude-namespace=PG-EXCLUDE-NAMESPACE
translate to -N, --exclude-schema=SCHEMA
do NOT dump the named schema(s)

@digital2real digital2real force-pushed the feature-pgdump-ns-support branch 2 times, most recently from 546e545 to cec4176 Compare August 11, 2022 21:00
--pg-namespace=PG-NAMESPACE
	translate to -n, --schema=SCHEMA
	dump the named schema(s) only

--pg-exclude-namespace=PG-EXCLUDE-NAMESPACE
	translate to -N, --exclude-schema=SCHEMA
	do NOT dump the named schema(s)
@@ -21,6 +21,8 @@ protected function configure()
$this->setName('db:dump')
->setDescription('Create a local dump of the remote database');
$this->addOption('schema', null, InputOption::VALUE_REQUIRED, 'The schema to dump. Omit to use the default schema (usually "main").')
->addOption('pg-namespace', null, InputOption::VALUE_REQUIRED| InputOption::VALUE_IS_ARRAY, 'Dump the named namespace/schema(s) only (Postgresql specific)')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this different than --schema above?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes : with postgresql schema != database (not like mysql or mariadb)
"A database contains one or more named schemas, which in turn contain tables. Schemas also contain other kinds of named objects, including data types, functions, and operators. The same object name can be used in different schemas without conflict; for example, both schema1 and myschema can contain tables named mytable. Unlike databases, schemas are not rigidly separated: a user can access objects in any of the schemas in the database they are connected to, if they have privileges to do so."
https://www.postgresql.org/docs/current/ddl-schemas.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants