aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/pg_backup_archiver.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pg_dump/pg_backup_archiver.c')
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index 8b55f5952c3..0f1afeacf79 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -1090,10 +1090,10 @@ ArchiveEntry(Archive *AHX, CatalogId catalogId, DumpId dumpId,
newToc->tag = pg_strdup(opts->tag);
newToc->namespace = opts->namespace ? pg_strdup(opts->namespace) : NULL;
newToc->tablespace = opts->tablespace ? pg_strdup(opts->tablespace) : NULL;
- newToc->owner = opts->owner ? pg_strdup(opts->owner) : NULL;
+ newToc->owner = pg_strdup(opts->owner);
newToc->desc = pg_strdup(opts->description);
- newToc->defn = opts->createStmt ? pg_strdup(opts->createStmt) : NULL;
- newToc->dropStmt = opts->dropStmt ? pg_strdup(opts->dropStmt) : NULL;
+ newToc->defn = pg_strdup(opts->createStmt);
+ newToc->dropStmt = pg_strdup(opts->dropStmt);
newToc->copyStmt = opts->copyStmt ? pg_strdup(opts->copyStmt) : NULL;
if (opts->nDeps > 0)
@@ -3600,7 +3600,7 @@ _printTocEntry(ArchiveHandle *AH, TocEntry *te, bool isData)
}
else
{
- if (te->defn && strlen(te->defn) > 0)
+ if (strlen(te->defn) > 0)
ahprintf(AH, "%s\n\n", te->defn);
}
@@ -3611,8 +3611,7 @@ _printTocEntry(ArchiveHandle *AH, TocEntry *te, bool isData)
* with DROP commands must appear in one list or the other.
*/
if (!ropt->noOwner && !ropt->use_setsessauth &&
- te->owner && strlen(te->owner) > 0 &&
- te->dropStmt && strlen(te->dropStmt) > 0)
+ strlen(te->owner) > 0 && strlen(te->dropStmt) > 0)
{
if (strcmp(te->desc, "AGGREGATE") == 0 ||
strcmp(te->desc, "BLOB") == 0 ||