Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1way30-002CRO-1g for pgsql-bugs@arkaria.postgresql.org; Sat, 20 Jun 2026 15:55:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1way2y-001rVE-0C for pgsql-bugs@arkaria.postgresql.org; Sat, 20 Jun 2026 15:55:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1way2x-001rV6-2N for pgsql-bugs@lists.postgresql.org; Sat, 20 Jun 2026 15:55:51 +0000 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1way2v-00000001S15-0Mc0 for pgsql-bugs@lists.postgresql.org; Sat, 20 Jun 2026 15:55:51 +0000 Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-4877b2c9e9fso2128876b6e.0 for ; Sat, 20 Jun 2026 08:55:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781970946; cv=none; d=google.com; s=arc-20240605; b=IAJNln5p54UhYqbBNab/JntVL6FGpXmQG/5p61m4fb2vdXknaqiRnUCS00rdADUiOK GfQdbKkbRhEFIbbULN37pIV/tKToj7R0HkBgRIsR0O6CbMkYvRZp2R5Q45103xQCkuTG R20DFl+9bdKQqhEJksapmtR6fHd0yPbBtm3RJASbhpkdlpVeriWdBVq2iP7BhOrpGDlc R5kt8MrN+FBGFRBCK9OieZF4if1qgcR5GotTW6+ZiBvChKEH25xyTqDGeLU+8hsNQnYb OuFbsNeCwUSi2TjLIFZoQo41JLOufQt+kQNkYbSNP7NzWpycCjMFh8z/5OuV//ufhDui +cVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=p38Qa/CN8+pkl2kX9/GUoVhVXwqJRQ3DpdjIlrxvLt0=; fh=/T4F5MDi4d/mcBxYfuSLije6Y6fsN7uzplrXhj1dI3M=; b=cr3+JVR0aDWVxX8V2wE76dV/EXLuaQIZAUUxhjV8EQOsXhktg0mXAcvs0XUF6xkZ1D uGg8Kl2hNS/s+klmS/091JFgc6O7OaSXwCStMlwnTOGHcw5+0m/R+loHHf0lgd8DIzmn OTU6kB/vPmlS25ozvDAQ8EpgvrI5LFGGY9wR5nytQk1oFCVhx7O0hOBGN9xtIECFVdjP hWkM9ne5UPOMQcJEMCagO+fzYiVgk/ykQmpf0y9XevEY0g7Mx1bNsNUBSh68d+I0nC+1 OgASkKUFupjW2oBDvvFetpHIC2up4yqjf+x851+PggibyYdg9WghORGtKvG1huMjQs7V bAig==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781970946; x=1782575746; darn=lists.postgresql.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=p38Qa/CN8+pkl2kX9/GUoVhVXwqJRQ3DpdjIlrxvLt0=; b=N1lNU2X6pIR9k2J7XWniRLTH7OKnicII9vJy2bjhWpAHmZ7pL9wLtqDRDj3DEv5ZO4 z14jsXhLrPhcNdWpjFNvamvsCoX4lo8ijRO0Bje5FEB1IcXe+g9f0B32nNHn2Epq4XLy HDUvSyjKDsAqvpJKBTkIUryMAOobtTJttkRCqMR2Ek9eNxwqDyVWiT9w0FFaHGU/P35h YDZM4RlfX/hwGJyeay+so31jXKER+NRpoU4P7ndVMUDMM10msdAWKA2sSxM4B5d0Nlqa yFWV0ivK19fcDGI2KzfaKuA9vmBO0osSnig7wQWWo+FI1ASSHD4nsMuGUa0N4EFK4wKp nTuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781970946; x=1782575746; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=p38Qa/CN8+pkl2kX9/GUoVhVXwqJRQ3DpdjIlrxvLt0=; b=qvR8UNlt/shKKugEz109CKQ10CurtfceuydpUxuPTRr7cLLdx1QSWn/I0qZRr5Jc1s HWnJDc56Aunwe56511xyOffd4WCodnVDJeu6+6n+KAvUsOUiU734QxJb2CKTKmlmF0qx IdR4OKDT1vwMbkTHklmuwwdu4VKCqWHkrNvoL7gkuCQAFllQQeM4BCiZbO2V1J5hK7Gw /3hOuo9HDxidK5mRWJ8G1yn5lQKVLhkx4CJXvgAF4fPDhE+5N+E9wIHw08FF3zrGPcO1 hLwG0u6OtekqHucej7R5WLcfYQId8OE5iIdSRJ1xUjYJ/GMjk9YslAGnnr3rs+syPmfP emLA== X-Forwarded-Encrypted: i=1; AFNElJ8JTSLUgTye6nB5Rm509Ur7RRrC7uhHx7WSmo+eryb5styADzGn85KTFS3r0tNGGNf/8r8WpGxh2A4/@lists.postgresql.org X-Gm-Message-State: AOJu0Yww6rtYUqQrnHNvY6vOpqkC8A6q84NOlAGq5Q6MlSzxAG4YbSlQ IxjDQoH8p+d2Zj10ncIJ92psCPxIVWFBH5I4Y7VgoGxsSb6fApS5Q7d6YEGyrsBUVMksHnNQYbB K61FVRS4hNc0fPZR0EYCsnmVa1eamJvJNL9Q6AD2XOQ== X-Gm-Gg: AfdE7cnQcLL+Ta/lVellOTEc2+AeF/yOLm3h+HxZMhljRyNYPH6StFqo3Y2vEtcokPS Mo6/xwlV7rsT8WBFUxkIsHvEZ8J3oDHIb1oMk0sNtkhawdd0XbYSaiUu4IgvNrgt0R5OWKQ4qUB o2eovcUOeF5h+wFC+JyqplaSuHn+LXQgCwQDgiG3HwRar037D7flcdslrU1I7XZ5JdFeLLFP6zU Avyxe7G7pwp1H3ekvt7rh0zOpzY/y3yffVzJoiiykG1cFlnk9IjyRWvLAo8fQL3pMOkFqP44GQP 4Rm/l3bUJzSZgLYPQW8rDQOAkVBXFYEALQOIfS/Q/cOcyCCwk6MIYIPCKFzkpNZmZj78CfX5ZFY XKboRe3Y+yokaAifZL0Mgq84= X-Received: by 2002:a05:6808:180b:b0:489:b4b1:56a9 with SMTP id 5614622812f47-489b4c09bf0mr5473246b6e.37.1781970946002; Sat, 20 Jun 2026 08:55:46 -0700 (PDT) MIME-Version: 1.0 References: <19529-c7eb1e7a0b07eae6@postgresql.org> In-Reply-To: <19529-c7eb1e7a0b07eae6@postgresql.org> From: Fujii Masao Date: Sun, 21 Jun 2026 00:55:34 +0900 X-Gm-Features: AVVi8CevYu-pJaaDSD9LACJuB8FYahmh1JjT5QIrDDM8X62t5UOWrzFUjXQpmD4 Message-ID: Subject: Re: BUG #19529: Documentation appears inconsistent with pg_dump --statistics behavior for CREATE STATISTICS objects To: igi@sraoss.co.jp, pgsql-bugs@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, Jun 20, 2026 at 8:19=E2=80=AFPM PG Bug reporting form wrote: > > The following bug has been logged on the website: > > Bug reference: 19529 > Logged by: Igi Izumi > Email address: igi@sraoss.co.jp > PostgreSQL version: 19beta1 > Operating system: Rocky Linux 10.2 x86_64 > Description: > > The PostgreSQL 19 pg_dump documentation currently states: > "When --statistics is specified, pg_dump will include most optimizer > statistics in the resulting dump file. This does not include all statisti= cs, > such as those created explicitly with CREATE STATISTICS, custom statistic= s > added by an extension, or statistics collected by the cumulative statisti= cs > system. Therefore, it may still be useful to run ANALYZE after restoring > from a dump file to ensure optimal performance; see Section 24.1.3 and > Section 24.1.6 for more information." > https://www.postgresql.org/docs/19/app-pgdump.html > > However, PostgreSQL 19 introduced support for restoring extended statisti= cs > with pg_restore_extended_stats(), and the following commits appear to add > support for dumping and restoring CREATE STATISTICS data: > > =E3=83=BBInclude extended statistics data in pg_dump > https://git.postgresql.org/gitweb/?p=3Dpostgresql.git;a=3Dcommitdiff;h=3D= c32fb29e9 > > =E3=83=BBAdd pg_restore_extended_stats() > https://git.postgresql.org/gitweb/?p=3Dpostgresql.git;a=3Dcommitdiff;h=3D= 0e80f3f88 > > Because of these changes, it appears that statistics created explicitly w= ith > CREATE STATISTICS are now handled by pg_dump --statistics, while the > PostgreSQL 19 documentation still states that they are not included. > > Could you please confirm whether the documentation is correct, or whether > this is a documentation bug? This looks like a documentation oversight in (maybe) the commit that added extended statistics support to pg_dump. I say that because I confirmed that pg_dump --statistics does dump the extended statistics for table t after running: CREATE TABLE t (i int, j int); INSERT INTO t SELECT n, n FROM generate_series(1, 100) n; CREATE STATISTICS ON i, j FROM t; ANALYZE t; Regards, --=20 Fujii Masao