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 1uY8QD-001dI4-HV for pgsql-general@arkaria.postgresql.org; Sat, 05 Jul 2025 19:19:37 +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 1uY8QB-009PCv-Ig for pgsql-general@arkaria.postgresql.org; Sat, 05 Jul 2025 19:19:36 +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 1uY8QA-009PCn-TW for pgsql-general@lists.postgresql.org; Sat, 05 Jul 2025 19:19:35 +0000 Received: from mail68.out.titan.email ([3.216.99.50]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uY8Q7-005wKi-1t for pgsql-general@lists.postgresql.org; Sat, 05 Jul 2025 19:19:34 +0000 Received: from localhost (localhost [127.0.0.1]) by smtp-out.flockmail.com (Postfix) with ESMTP id A893E100013 for ; Sat, 5 Jul 2025 19:19:29 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=YMvCV2vqy0+a15LSdK5jPeMacGTKAVTgnioaPGhuH+Y=; c=relaxed/relaxed; d=pfortin.com; h=from:message-id:in-reply-to:mime-version:to:references:date:subject:from:to:subject:date:message-id:in-reply-to:references:cc:reply-to; q=dns/txt; s=titan1; t=1751743169; v=1; b=bJ2S7vPGC99PNgc9/sFkdUYxvcXjzSvEPiShZxIjgDufMRKQEvI5mipmD91y4+EZ8hXiJGkO zcBOnRCaF8uv43+YYPtA888r5I8qcLvytv5fmXGlfbOTIXP20XjWHgxKT9wZ3fjGz9JK9H5RXuj A0YxY+mbb8EaoakEsxnZXyIM= Received: from pfortin.com (h194.51.155.207.dynamic.ip.windstream.net [207.155.51.194]) by smtp-out.flockmail.com (Postfix) with ESMTPA id 64C60100011 for ; Sat, 5 Jul 2025 19:19:29 +0000 (UTC) Date: Sat, 5 Jul 2025 15:19:28 -0400 Feedback-ID: :pf@pfortin.com:pfortin.com:flockmailId From: Pierre Fortin To: pgsql-general@lists.postgresql.org Subject: Re: pg_upgrade: can I use same binary for old & new? Message-ID: <20250705151928.3a9ea7b1@pfortin.com> In-Reply-To: <65041.1751740220@sss.pgh.pa.us> References: <20250705125207.31b4d475@pfortin.com> <20250705142416.06e99667@pfortin.com> <65041.1751740220@sss.pgh.pa.us> X-Mailer: Claws Mail 4.3.1git142 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-F-Verdict: SPFVALID X-Titan-Src-Out: 1751743169513154872.20113.1701391867902724380@prod-use1-smtp-out1002. X-CMAE-Score: 0 X-CMAE-Analysis: v=2.4 cv=QtKk3Uyd c=1 sm=1 tr=0 ts=68697ac1 a=qh1+orYxbfpu+9ysfXJjVg==:117 a=qh1+orYxbfpu+9ysfXJjVg==:17 a=kj9zAlcOel0A:10 a=CEWIc4RMnpUA:10 a=BgpjXcZQAAAA:8 a=ja5_5YsUEAnF8CAPLPUA:9 a=CjuIK1q_8ugA:10 a=Jyo2sqUHqs9O1PedRBIf:22 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, 05 Jul 2025 14:30:20 -0400 Tom Lane wrote: Forgive my ignorance; always trying to learn more... :) >pf@pfortin.com writes: >> On Sat, 5 Jul 2025 11:11:32 -0700 Adrian Klaver wrote: >>> How did you measure above? > >> # du -sb /var/lib/pgsql/data >> 8227910662297 /var/lib/pgsql/data > >It's likely that there's a deal of bloat in that. Even if there's not >much bloat, this number will include indexes and WAL data that don't >appear in pg_dump output. Does this imply that on restore, I'll have to re-index everything? >>> What was the pg_dump command? > >> Didn't try given: >> $ df /mnt/db >> Filesystem Size Used Avail Use% Mounted on >> /dev/sdh1 17T 13T 3.0T 82% /mnt/db > >I'd say give it a try; be sure to use one of the pg_dump modes >that compress the data. OK... I failed to mention I have several databases in this cluster; so digging into pg_dumpall, I see: --binary-upgrade This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice. pg_upgrade has --link option; but I'm puzzled by this option in a dumpall/restore process. My imagination wonders if this alludes to a way to do something like: pg_dumpall --globals-only --roles-only --schema-only ... Would restoring this be a way to update only the control structures? Big assumption that the actual data remains untouched... Inquiring mind... :) Back to my upgrade issue... All my DBs are static (only queries once loaded). Assuming the dumpall file fits on one of my drives: pg_dumpall -f /PG.backup -v appears to be all I need? pg_dump has compression by default; but I don't see compression with dumpall other than for TOAST. Thanks, You guys are awesome! > regards, tom lane