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

Commitea00ab8

Browse files
committed
Prevent pg_dump from dumping the comment (if any) on the 'public' schema.
This is to avoid uselessly requiring superuser permissions to restorethe dump without errors. Pretty grotty, but no better alternative seemsavailable, at least not in the near term.
1 parent98c0ebc commitea00ab8

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

‎src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*
1717
* IDENTIFICATION
18-
*$PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.151 2007/11/24 20:26:49 tgl Exp $
18+
*$PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.152 2008/01/14 19:27:41 tgl Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -2528,11 +2528,17 @@ _printTocEntry(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt, bool isDat
25282528
/*
25292529
* Avoid dumping the public schema, as it will already be created ...
25302530
* unless we are using --clean mode, in which case it's been deleted and
2531-
* we'd better recreate it.
2531+
* we'd better recreate it. Likewise for its comment, if any.
25322532
*/
2533-
if (!ropt->dropSchema&&
2534-
strcmp(te->desc,"SCHEMA")==0&&strcmp(te->tag,"public")==0)
2535-
return;
2533+
if (!ropt->dropSchema)
2534+
{
2535+
if (strcmp(te->desc,"SCHEMA")==0&&
2536+
strcmp(te->tag,"public")==0)
2537+
return;
2538+
if (strcmp(te->desc,"COMMENT")==0&&
2539+
strcmp(te->tag,"SCHEMA public")==0)
2540+
return;
2541+
}
25362542

25372543
/* Select owner, schema, and tablespace as necessary */
25382544
_becomeOwner(AH,te);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp