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 1vTjEp-009FbT-1w for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Dec 2025 16:09:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vTjEo-004IY8-1p for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Dec 2025 16:09:55 +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.96) (envelope-from ) id 1vTjEo-004IY0-0q for pgsql-hackers@lists.postgresql.org; Thu, 11 Dec 2025 16:09:55 +0000 Received: from mail-qt1-x82a.google.com ([2607:f8b0:4864:20::82a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vTjEn-000ASf-0U for pgsql-hackers@lists.postgresql.org; Thu, 11 Dec 2025 16:09:53 +0000 Received: by mail-qt1-x82a.google.com with SMTP id d75a77b69052e-4f0013c54efso1118531cf.1 for ; Thu, 11 Dec 2025 08:09:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765469392; x=1766074192; 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=zCYz9N3G91aOVPdlF5gS893PwIQOdKbtfIPdKgpPc80=; b=fqCGi6hgWhd7a/3jmx1aVeZ0MqBLXijBRAllrDrSZeqrZncG5PfgL5HCWaEwfUScOm UyeWspt3axZZHF1KinmK6IddEmQvpr/K/nqAA4VZK7keZ07tijNYNN/noP6NCN7FvqjR EWXgJwHQv0Tbp3OYvw+31sXr24aV9XN+19F/coRhK+ZsJ6sR4S54wXj5KC/0Zx89n3Z2 uNNmD2X0e5wL608cL/3LBHlLUwdjLlM2owBC9P14XkSH6ZiBfEhY6glOuzmU9Kkb+PVA uO3VgqWZWwF33l8UwSD5zUcJWh75K/eN0LVaNDjl9UjnMr4JjwiDe9s/7anTXlvZvJY4 Kagg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765469392; x=1766074192; h=content-transfer-encoding:cc: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=zCYz9N3G91aOVPdlF5gS893PwIQOdKbtfIPdKgpPc80=; b=cVSMEjXOhY1CHD8/hWciHW2Qji9Np0uqpuAmgnhVqth46D4eDTaWvX4JYYUxOu7nHM 4nXRaGLjyQBiNNjQMqeeUelrotQORSlLhSOuVkEmKVs9ssilV6Jlqnb+f7VK1LM4G1VA yqWoUsh2xhgRkhSXLHrKpecv+Wyp2Pk7yGwEtQVUCs+48HSc+N/4vmo4sKNXkQQwEda3 xNA4uL5Sjdnl7HMZljw7JNDEPXxdKAhHc5qCMnmK7FkjwRtJ2Mx/kSNRZRi+SnftcxvS IKiBI1SVgZfQIKAiMN6oiIv5KH7V0Y3IXU6VNC7U71hVTuI9L9Po6AGrcR4hPVRzvo4m 1Udw== X-Forwarded-Encrypted: i=1; AJvYcCVtGvpvHEIyiXO/YH8tFR8HmUxr+8LnWg4Ag9qlLBtKrJQyLQpZm7nt1WAJHAbHTb4tsH9qB3zFnPqXPsg+@lists.postgresql.org X-Gm-Message-State: AOJu0Yzj8ls74e71s+awJRze54/m76a+yLUg4+mqe/f3f2No5zM6oDDq r0TCprYy9nL+wdAqHQSQ9Sb7VwetjzwE105+IGAaFljCQZ+F41JI7HJHhfjmDJWaR0i4z8oCGD+ IFLJt9nDO8GdPXIw28a4BHH5qkqSzWlw= X-Gm-Gg: AY/fxX7nA8NtbfkHGY97OuXb5g39qWwhFvxnOVSKFTh6knYehVhuUZIaJYkZ6z6BCXK PLVfLAPaxLcimwLSKL1hb2Rzs1NNMGBe8LIRCDZjVBq3WyF8iTb2Qkq3dLrk9v1YKqsfNEq5gJj XDX6tuO/ExJY06oc39L1m4rH0rV0IhiAr2IzyQ/15ATFzb0M6VqI0IJwGVsON72gzZzpYXRDgyO qgH/YxKRgIAoc7b150NTxzRGklO2RA4UsxHkKXGx0fd1q0bEcFcCOmJNga0VLt66w0iCe1m X-Google-Smtp-Source: AGHT+IHDSTy4L43Ihox7p+8uorOW4y4ZpuvwMlu7i5UqHzmOY6eJVJZknVjImujm6maGfn0FbB+0EE1zAF0hK6BiRYA= X-Received: by 2002:a05:622a:7a8e:b0:4f1:c805:1602 with SMTP id d75a77b69052e-4f1c805186amr11251381cf.44.1765469391783; Thu, 11 Dec 2025 08:09:51 -0800 (PST) MIME-Version: 1.0 References: <3f22a8bb-29e8-40cc-97a1-309181da2c13@dunslane.net> <2bed001a-462c-42da-9a6b-3c7884502932@dunslane.net> <20250824010811.4d.nmisch@google.com> <82eb35b8-7f07-493b-b689-0934919e1dc3@dunslane.net> <17555e46-4fb2-4265-90e0-95cb8ed584a6@dunslane.net> In-Reply-To: From: Mahendra Singh Thalor Date: Thu, 11 Dec 2025 21:39:39 +0530 X-Gm-Features: AQt7F2p4ZGtFL9BrxxraXGxAYEcdKmOVt9uiTTauofuM63BfdbuFP4k7r8txrc4 Message-ID: Subject: Re: Non-text mode for pg_dumpall To: tushar Cc: Vaibhav Dalvi , 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, 10 Dec 2025 at 19:08, tushar wrote: > > > > On Tue, Dec 9, 2025 at 12:18=E2=80=AFAM Mahendra Singh Thalor wrote: >> >> On Mon, 8 Dec 2025 at 22:39, tushar wrot= e: >> >> Here, I am attaching an updated patch for the review and testing. This >> can be applied on commit d0d0ba6cf66c4043501f6f7. >> > > Thanks, Mahendra, please refer to this scenario where if "--transaction-= size" switch is used with pg_dumpall/pg_restore, then the table creation f= ails (or the table is not created) > > Steps to reproduce: > 1. Connect to the psql terminal, create a table/insert rows { create tabl= e t(n int); insert into t values (generate_series(1,15)); } > 2. Perform pg_dump operation { ./pg_dumpall -Ft -f tar.dump } > 3. new cluster: > try to restore with --transaction-size switch { ./pg_restore -Ft tar.du= mp -C -d postgres --transaction-size=3D10 } =3D Table failed to create > > I have checked via pg_dump/pg_restore using --transaction-size, and it is= working fine, i.e, table is created successfully > > ./pg_dump -Ft -f tar.d postgres > ./pg_restore --transaction-size=3D10 -Ft -d new_database tar.d > > regards, > > Thanks Tushar for the report. If transaction-size is given as non-zero, then pg_restore behaves like "-e/--exit-on-error". means if there is any error in restore, then exit without restoring the full cluster. Here, in our case, as the cluster already has a role with the current user in restore, we are reporting error "pg_restore: error: could not execute query: ERROR: role "role" already exists" and after this error, restore is exiting. If you restore using a different role, then you will not get any error and the full cluster will be restored. I will add some handling to ignore the "CREATE ROLE current_user" command in pg_restore. --=20 Thanks and Regards Mahendra Singh Thalor EnterpriseDB: http://www.enterprisedb.com