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 1uURQC-003Kjw-6A for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Jun 2025 14:48:20 +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 1uURQ9-004GQl-D1 for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Jun 2025 14:48:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uURQ9-004GQZ-3B for pgsql-hackers@lists.postgresql.org; Wed, 25 Jun 2025 14:48:17 +0000 Received: from mail-io1-xd2b.google.com ([2607:f8b0:4864:20::d2b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uURQ7-003wNE-34 for pgsql-hackers@postgresql.org; Wed, 25 Jun 2025 14:48:16 +0000 Received: by mail-io1-xd2b.google.com with SMTP id ca18e2360f4ac-86d0bd7ebb5so201211639f.0 for ; Wed, 25 Jun 2025 07:48:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750862895; x=1751467695; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=lUU2VfXuttfDzduRXaaMPpE8i2IlE8FwAJBFVaur+m0=; b=iIzCLUVwd4+wUTcz6fN/bA383qtw4J/uO5JP6ooGZXk+OHXdgeUXKbbGDoM9DKLHDe TjldbL402K/TNNaUiwHAl/rr5taLKLirvJ5j/XHpx7XFBTtfHrhPf3dayES2cLYkFIAy uDQZdR/kvFOBbZq+WbKrASWFvE1loZqzKQYGHuQjr9j+/yTnrsKOifzmNviVXTIz61Hm YemSFUvWtuGvj2QOkRqr7xy0Fe/c/GWnYIM0fFyvYAlt0DlpLqjRiJ4HgIs2L+cu5uON z2DTXU7sKKiaStuYXF1GxCHw9VwCR+eNEiKe90/nOTsQSkQR4cxP3iiLjYj/n3Cmv1WN x1NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750862895; x=1751467695; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=lUU2VfXuttfDzduRXaaMPpE8i2IlE8FwAJBFVaur+m0=; b=T2ThBhBWOBwCHTdAcWWVl6x2qXW8WcDBVF9ZC3rJFH2STtZY6egLCCEGEDuXhtKg7e k3fs/G5QYDV/kho/0PoIavctt4uFlywByWPAbDgLTJEIzihQM4bFjAWM+iefFLmlEk23 3hyJsV5yjnf7LB+kdAJNstzrjEVFDUCRMY1UQK0XrtoiuXrtFmXR3afbJsU1ttEaYcPd Xqk+c2Zs1oY1cjC7Y3jrwWg+Yq39oSat/Rm0lKQNvPjQh8qfaxo974hpMZLzpkhMWEoY bA4PBR2nPu/eM8TbvABeGFABDA5TwXGvxyM5geoLMhj1OddLh/rjwmlQlA0gFSExzpVQ 9txA== X-Forwarded-Encrypted: i=1; AJvYcCWen//I5kA7LgnfL58nqUYQlwSC5wcSm8T+A134PbexKwSMRmFw4pP0t3aPFNZ1KMa0orutBNFJtFc5jd+3@postgresql.org X-Gm-Message-State: AOJu0YxV/VwsTHVNcnlsocPhCZkt3UxC42/Pccoxv9H5++EB8mE2TFV5 X9GxhlE6LavWlFigo9f4Vm3yhws4Zp73V6zkdyoK+dVxzTFoX47yBRDs X-Gm-Gg: ASbGncs9JIaZQBaOwxeA7ACBSboXyLU54Fj5W1Y9Ouz94szxdPLyjLZ2rVgH3nhZWSh llcI5Izuqxh+kjGgjvY+CyXN9RuMzvvcTal3pDfQyqfzoaHytwmxZxP/wos2r9DvttdFBkNTyUS JDpnQzdL9ImQbjFDeAvtnWyA9sCjZvdGAZPwSmR1eCFDkWMGdsSDDNMQLpiYTxVflsMKvZUujti 13eeW7i2Oynz9G9+XWRrJXpo+VIncTrQq67XB55ZivIw5aMoAoIEsWz5SRh189f5FiKe08yH1eF eipJY3cI67olrVthCiaihOiNYHVhR2IoUckhQHMPAG1T2Uu8mqN9JqtDXxPuaEI12Dq8Gs42pCO s2aC4tsiSiehw55VbE/RV+Yme1/JFPujTz9JFYoPXfM6FNUNwLh5pGWvRRg== X-Google-Smtp-Source: AGHT+IEhdvn5UCtytYj85zMkWWufuT9pZuJhX6UqFoGYO7P09xl2bpnLeRwSWt4g1qsLjNyt0JTFUQ== X-Received: by 2002:a05:6602:3413:b0:867:6680:cfd with SMTP id ca18e2360f4ac-8766b70fce3mr458052639f.1.1750862895132; Wed, 25 Jun 2025 07:48:15 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-8762b5cf31esm392226439f.10.2025.06.25.07.48.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Jun 2025 07:48:14 -0700 (PDT) Date: Wed, 25 Jun 2025 09:48:12 -0500 From: Nathan Bossart To: Fujii Masao Cc: Robert Haas , Jeff Davis , Peter Eisentraut , pgsql-hackers Subject: Re: pg_dump --with-* options Message-ID: References: <7bf0246542713d80f12c738c1d365d1365750c18.camel@j-davis.com> <5e398522803da9bf3f9fc33ca43084ec21ab0fcd.camel@j-davis.com> <031558c60e84362898922caa6a90587e7fdf2a57.camel@j-davis.com> <3cc4f166-0b58-47e2-a03c-7c2873d62b14@oss.nttdata.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3cc4f166-0b58-47e2-a03c-7c2873d62b14@oss.nttdata.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Jun 25, 2025 at 08:18:28AM +0900, Fujii Masao wrote: > For pg_dump and pg_dumpall, I agree with Jeff's idea in [1], > but if the statistics is skipped by default, I don't think > we need a --no-statistics option. So, here's how I think > the options should work: > > * Keep: --schema-only, --data-only, --statistics-only, --no-schema, --no-data, -and -statistics > * Remove: --no-statistics, --with-schema, and --with-data > * Combinations: > Schema + Data + Stats : --statistics > Schema + Data : (default) > Schema + Stats : --no-data --statistics > Data + Stats : --no-schema --statistics > Schema only : --schema-only (or --no-data) > Data only : --data-only (or --no-schema) > Stats only : --statistics-only (or --no-schema --no-data --statistics) I believe this is equivalent to the second option I proposed upthread [0]. Jeff proposed a variation of this option that keeps --no-statistics around so that we could more easily change the default for stats down the road [1]. > As I mentioned in [2], if we treat --statistics in the similar way to > --sequence-data, i.e., allow --statistics to be used with --schema-only > or --data-only, we could simplify further: > > * Keep: --schema-only, --data-only, --statistics-only, and --statistics > * Remove: --no-schema, --no-data, --no-statistics, --with-schema, and --with-data > * Combinations: > Schema + Data + Stats : --statistics > Schema + Data : (default) > Schema + Stats : --schema-only --statistics > Data + Stats : --data-only --statistics > Schema only : --schema-only > Data only : --data-only > Stats only : --statistics-only > > Some may find this confusing due to mixing --statistics with --schema-only > or --data-only, so I understand if there's hesitation. Hm. I didn't really intend for --sequence-data to set a precedent here. That's mostly intended as a submode for --binary-upgrade. Perhaps we should consider removing it as a documented option and instead convert it to --binary-upgrade=sequence-data or something. In any case, allowing "only" options to be used in conjunction with --statistics seems a little confusing to me. But I'm not strongly opposed to the idea. > For pg_restore, I believe there's agreement to restore statistics > by default if they exist in the archive. So: > > * Keep: --schema-only, --data-only, --statistics-only, --no-schema, --no-data, and --no-statistics > * Remove: --with-schema, --with-data, and --statistics > * Combinations: > Schema + Data + Stats : (default) > Schema + Data : --no-statistics > Schema + Stats : --no-data > Data + Stats : --no-schema > Schema only : --schema-only (or --no-data --no-statistics) > Data only : --data-only (or --no-schema --no-statistics) > Stats only : --statistics-only (or --no-schema --no-data) +1 [0] https://postgr.es/m/aFLxvrh71VWqdL9A%40nathan [1] https://postgr.es/m/031558c60e84362898922caa6a90587e7fdf2a57.camel%40j-davis.com -- nathan