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.94.2) (envelope-from ) id 1uIBn3-00HQQo-BP for pgsql-hackers@arkaria.postgresql.org; Thu, 22 May 2025 19:41:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uIBn2-007fyG-7U for pgsql-hackers@arkaria.postgresql.org; Thu, 22 May 2025 19:41:16 +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.94.2) (envelope-from ) id 1uIBn1-007fy8-U9 for pgsql-hackers@lists.postgresql.org; Thu, 22 May 2025 19:41:15 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uIBmz-000OZb-0R for pgsql-hackers@lists.postgresql.org; Thu, 22 May 2025 19:41:15 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 54MJf7cT1816937; Thu, 22 May 2025 15:41:07 -0400 From: Tom Lane To: Greg Sabino Mullane cc: Jeff Davis , Robert Haas , Ashutosh Bapat , Corey Huinker , Andres Freund , Michael Paquier , Nathan Bossart , Bruce Momjian , Matthias van de Meent , Magnus Hagander , Stephen Frost , Peter Smith , PostgreSQL Hackers , alvherre@alvh.no-ip.org, jian he Subject: Re: Statistics Import and Export In-reply-to: References: <97b451228227c555be1a4f79c4a62ddec9a74f06.camel@j-davis.com> <1457469.1740419458@sss.pgh.pa.us> <8d13e4296408c53a93390525d0bcb906cbd13df4.camel@j-davis.com> <768b2a237e892bf1334bdcbb066cdc1bd1368cb2.camel@j-davis.com> <78dd61cf971436c22c8e7522a4868492b09d1194.camel@j-davis.com> Comments: In-reply-to Greg Sabino Mullane message dated "Thu, 22 May 2025 15:29:38 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1816935.1747942867.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Thu, 22 May 2025 15:41:07 -0400 Message-ID: <1816936.1747942867@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Greg Sabino Mullane writes: > On Thu, May 22, 2025 at 2:52 PM Jeff Davis wrote: >> * The default for pg_restore is --no-statistics. That could cause a minor >> surprise if the user specifies --with-statistics for pg_dump and >> not for pg_restore. > Hm...somewhat to my own surprise, I don't like this. If it's in the dump, > restore it. Yeah, I tend to lean that way too. If the user went out of their way to say --with-statistics for pg_dump, how likely is it that they don't want the statistics restored? Another argument pointing in that direction is that the definition Jeff proposes creates an inconsistency in the output between text mode: pg_dump --with-statistics ... | psql and non-text mode: pg_dump -Fc --with-statistics ... | pg_restore There is no additional filter in text mode, so I think pg_restore's default behavior should also be "no additional filter". regards, tom lane