patternsqlMinor
pg_dump: No matching schemas were found
Viewed 0 times
pg_dumpschemaswerefoundmatching
Problem
I am trying to dump a schema from Postgres 9.4, running on Cents 6.5, but I get an error:
pg_dump: No matching schemas were found
Here is the command I am running:
I am a little confused by this as when I run
If I run pg_dump for all schemas the
There are no error's in the Postgres logs.
Anyone have any ideas?
pg_dump: No matching schemas were found
Here is the command I am running:
pg_dump -U postgres -n "OLD-TODELETE-bushes" --verbose site > output_nf
I am a little confused by this as when I run
select schema_name from information_schema.schemata, I can see the schema name.If I run pg_dump for all schemas the
OLD-TODELETE-bushes is dumped to file, as expected.There are no error's in the Postgres logs.
Anyone have any ideas?
Solution
Fixed this by changing the quotes from
See: pg_dump doesn't dump datascheme with uppercase letters in
...where Tom Lane replied:
The problem is that there are two levels of quoting needed: one for the shell and one for SQL. As you wrote it, the double quotes are stripped off by the shell and so pg_dump gets Schema, which is case-folded per normal SQL rules. So you need to write:
Now, the shell eats the single quotes and passes "Schema" to pg_dump.
"schema_name" to '"schema_name"'See: pg_dump doesn't dump datascheme with uppercase letters in
...where Tom Lane replied:
The problem is that there are two levels of quoting needed: one for the shell and one for SQL. As you wrote it, the double quotes are stripped off by the shell and so pg_dump gets Schema, which is case-folded per normal SQL rules. So you need to write:
pg_dump -n '"Schema"' -U postgres databaseNow, the shell eats the single quotes and passes "Schema" to pg_dump.
Code Snippets
pg_dump -n '"Schema"' -U postgres databaseContext
StackExchange Database Administrators Q#112392, answer score: 7
Revisions (0)
No revisions yet.