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 1uf0HR-000qUu-O6 for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Jul 2025 18:02:58 +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 1uf0HP-009gSC-UV for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Jul 2025 18:02:56 +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 1uf0HP-009gS3-Kz for pgsql-hackers@lists.postgresql.org; Thu, 24 Jul 2025 18:02:55 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uf0HM-000ds9-1m for pgsql-hackers@lists.postgresql.org; Thu, 24 Jul 2025 18:02:55 +0000 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-607ec30df2bso2595016a12.1 for ; Thu, 24 Jul 2025 11:02:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753380171; x=1753984971; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=V/+AW3rd7d2ybi1FVAeYRLQdFq91awsll+YqP5sj5Uw=; b=cuW1OvUetvTH154s+aHaIY9q/gnqkTmcWJP+Wo5tWwheQsKdArvrS0p28ZHMuH/7jA knR6pI+HHvepVISm/LePGMsCIF/zJa4P4buLLSau97vTILx7RQ6CL5SACq1Wy9uRru81 /DcXnuwdESAQxKtRMBJ73eu3x8mk2a6AQQ4NymFg4xBbAZu9EwUTqHZhDh2HFa2F2XME hGmnlXhoi/oD0Wg3D9kciXclD08dzuiDCxBtGlOO9lpKZDYNkFyzVn46DvQpnEI6stmX 9sSZ0Fkk8cgQqU+meeJByEJ7wnCr4zCzoWrXYs9P1/2Vm7bktX61lCmfzfxkPXrTFB3g N/kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753380171; x=1753984971; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=V/+AW3rd7d2ybi1FVAeYRLQdFq91awsll+YqP5sj5Uw=; b=Nf1NhJSzvU6FqAi4/ZmY7BAVG1HT3VaiMSiDyg+9NQ727umrv0P+FSS21+vGfX+Ywm d1KIVt/1tHnrfb8QsP4KrlUy6zKoA/lX0QCy3cp1lli+KbTBGbWwsEcKefc0Z1FBUuu+ eL21O6wiS0MV9+OYOw9C5V+uSKHaJ4Ls0yCScsmflBzRCLpNlidX59zzgS69BCwoAatQ V3tpENgD++LZ9bfjLxzl6TxCg1Ib0ElUpVlUuBNO/V6W3XR62yB7ghFg0kW4ppx2PCLl MfjTps017vnEu3ReSpn7a2gwj9wBaKQVOnnBnL6vou5zrdDGUYWaXh7T0lPhasXcpcZw 99fg== X-Forwarded-Encrypted: i=1; AJvYcCXsEtYpvB5jUpRmCrFxzaI2kFFc4D7vg9apx5wy0asqhlxysbF4eC6/ucZuVZ7H8oqd6rGwUd2E0BZ+ey2M@lists.postgresql.org X-Gm-Message-State: AOJu0YxeIAztTGjJ86D8MC1nnXqAj1LZzNzPtDx1HUChyRV3Gjy9B+Ds s9Gfj52GALokIZocFHWusLt1ifHw+xe2cnUbIbtUw7ZiwDpL6DgDk+oLbrU3poUIllsIx8aD/Yy kIz5JdS5sb8EPd91CynvTDbDzKHZkBTA= X-Gm-Gg: ASbGncvvszqd6B4hZgM+0P+KKSxFGxcAH/LWG4xGrSGYV/JUGRkKrEEZ4rmY7sDVcJS Z8Ma1KU7RefC6uGztupor9rGehz9cO6QxjyJYyrTPr8Xr7yqCUqvHMlykbOoV/EUEpDShabmeo8 8buRAKKyli3ipc2G41zyvlq9lWiZBvYGtOr6ip2PyI66CEktrvXC8oafHw3w5C/cX12q3Aujd5W cCZWHM= X-Google-Smtp-Source: AGHT+IEeDeErcRoW4tcrCZiGE6V0oCtltQvd/ayTRoVDl0hLoutKK2nBONXVG8e2IdtZ873x2eCGQbd9CZCS5Tq8dIM= X-Received: by 2002:a17:907:7b81:b0:aee:e698:1afd with SMTP id a640c23a62f3a-af2f8d4fc11mr785539466b.43.1753380170623; Thu, 24 Jul 2025 11:02:50 -0700 (PDT) MIME-Version: 1.0 References: <202503311812.vxg5b7rzfgf6@alvherre.pgsql> <616efe2c-3986-43cf-b88c-4435849acf9e@dunslane.net> <948154fe-0278-4f4c-8f5a-085e12f03163@dunslane.net> <20250708212819.09.nmisch@google.com> In-Reply-To: From: Robert Haas Date: Thu, 24 Jul 2025 14:02:39 -0400 X-Gm-Features: Ac12FXwbczMe2EtGVkzTLTrilsICfp0qJvpIugAueexm2CROZHQ1oVi2xTN3zIE Message-ID: Subject: Re: Non-text mode for pg_dumpall To: Mahendra Singh Thalor Cc: Noah Misch , Andrew Dunstan , =?UTF-8?Q?=C3=81lvaro_Herrera?= , jian he , Srinath Reddy , pgsql-hackers@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 Wed, Jul 9, 2025 at 2:51=E2=80=AFPM Mahendra Singh Thalor wrote: > > This drops all databases: > > > > pg_dumpall --clean -Fd -f /tmp/dump > > pg_restore -d template1 --globals-only /tmp/dump > > > > That didn't match my expectations given this help text: > > > > $ pg_restore --help|grep global > > -g, --globals-only restore only global objects, no database= s > > Databases are global objects so due to --clean command, we are putting > drop commands in global.dat for all the databases. While restoring, we > used the "--globals-only" option so we are dropping all these > databases by global.dat file. > > Please let us know your expectations for this specific case. I am not sure whether pg_dumpall --clean should ever drop databases, but it certainly shouldn't do it with --globals-only. In that case, it's not restoring the databases, so dropping them seems catastrophically bad. --=20 Robert Haas EDB: http://www.enterprisedb.com