0001-Fix-pg_restore-with-schema-and-statistics-only.patch

text/plain

Filename: 0001-Fix-pg_restore-with-schema-and-statistics-only.patch
Type: text/plain
Part: 0
Message: Re: pg_restore handles extended statistics inconsistently with statistics data

Patch

Format: format-patch
Series: patch 0001
Subject: Fix pg_restore with --schema and --statistics-only
File+
src/bin/pg_dump/pg_backup_archiver.c 0 1
From b084d8c19ba8846bcd9d337d47ed0b439ca51378 Mon Sep 17 00:00:00 2001
From: Michael Paquier <michael@paquier.xyz>
Date: Fri, 12 Jun 2026 14:56:59 +0900
Subject: [PATCH] Fix pg_restore with --schema and --statistics-only

Attempting to restore a schema with only statistics skipped all the
statistics of the schema, but it should not.
---
 src/bin/pg_dump/pg_backup_archiver.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index 2fd773ad84f3..45a8291f1f2f 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -3175,7 +3175,6 @@ _tocEntryRequired(TocEntry *te, teSection curSection, ArchiveHandle *AH)
 	 */
 	if (strcmp(te->desc, "ACL") == 0 ||
 		strcmp(te->desc, "COMMENT") == 0 ||
-		strcmp(te->desc, "STATISTICS DATA") == 0 ||
 		strcmp(te->desc, "SECURITY LABEL") == 0)
 	{
 		/* Database properties react to createDB, not selectivity options. */
-- 
2.54.0