Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita2de017

Browse files
committed
Do not require 'public' to exist for pg_dump -c
Commit330b84d didn't contemplate the case where the public schemahas been dropped and introduced a query which fails when there is nopublic schema into pg_dump (when used with -c).Adjust the query used by pg_dump to handle the case where the publicschema doesn't exist and add tests to check that such a case no longerfails.Back-patch the specific fix to 9.6, as the prior commit was.Adding tests for this case involved adding support to the pg_dumpTAP tests to work with multiple databases, which, while not a largechange, is a bit much to back-patch, so that's only done in master.Addresses bug #14650Discussion:https://www.postgresql.org/message-id/20170512181801.1795.47483%40wrigleys.postgresql.org
1 parent55968ed commita2de017

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎src/bin/pg_dump/pg_dump.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3659,9 +3659,14 @@ getNamespaces(Archive *fout, int *numNamespaces)
36593659
* essentially a no-op because the new public schema won't have an
36603660
* entry in pg_init_privs anyway, as the entry will be removed when
36613661
* the public schema is dropped.
3662+
*
3663+
* Further, we have to handle the case where the public schema does
3664+
* not exist at all.
36623665
*/
36633666
if (dopt->outputClean)
3664-
appendPQExpBuffer(query," AND pip.objoid <> 'public'::regnamespace");
3667+
appendPQExpBuffer(query," AND pip.objoid <> "
3668+
"coalesce((select oid from pg_namespace "
3669+
"where nspname = 'public'),0)");
36653670

36663671
appendPQExpBuffer(query,") ");
36673672

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp