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 1vdOp1-0004jq-2w for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Jan 2026 08:23:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vdOp0-00ChAA-2i for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Jan 2026 08:23:15 +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.96) (envelope-from ) id 1vdOp0-00Ch92-1V for pgsql-hackers@lists.postgresql.org; Wed, 07 Jan 2026 08:23:15 +0000 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vdOoy-0052yO-2p for pgsql-hackers@lists.postgresql.org; Wed, 07 Jan 2026 08:23:14 +0000 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-64b9dfc146fso1185895a12.0 for ; Wed, 07 Jan 2026 00:23:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1767774191; x=1768378991; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=yO+PmBVuSPZr1PqUDuYei263MWGhu3uEtita7DjBwkw=; b=H+zyC4C4j0hD0wlxeunQXhTJNGeuoJon16l/L9sh6h8zKZM+ZXUNYgHpST/beMZwbu eiuUyDVrqU2NSBp/YqAgvuSeR1RLsd07XYZUvXe0F+xrgIFlehWMNO16NI28f+mMoseZ HY/IAgUtOMHaaL/cy4lgWXsItzjcnAiKOLcBnF30zYRdq6f/ZA27v4uPNG0XViGo0a3Y jUjDhlwvUp3Nn70+RtrdTD2XUHj1hB15bBq8J6K4/22ppyPqfL9B5Iuanx8rHoNtOQ2C UQ7lwVAq3G6V3YWW1NOmpxiEWKR5jEdEwtbGjgZ5V0Fi41JovPpVB+WAo1Htlwd4Vl4z Zoog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767774191; x=1768378991; h=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=yO+PmBVuSPZr1PqUDuYei263MWGhu3uEtita7DjBwkw=; b=hNKMX4uNJHXui4rlTM+4kULabmOBWrW5tSV1gR3cifiS6Q/+r0tTd/A9G7I1Z2zw1O X23/LSf+69g0SsHwyIEy0NDpxClv/PNsTaA8rMP34Rili2Pm7YjvKME94U59CyifaDEA /lUuRFr+YeYUXaZoefasUOUeGIRBD9/G+NzUVkydPvAOZdJoi9h57gUQu3NgHWhFO+Gx NXvKNTWdfA9rLJaC0z/KK7B4u4+Bc0RXVBVvXTqcJ6bizRwqbi+CPyXz6osA1qdPkfvm oY9iDsv5OZdLguh/01mkx2Cd4ydBgp6hVthsMD2V9uz5S5GC/Rs6yeXemqQ9H0Xj+nT1 5JYg== X-Forwarded-Encrypted: i=1; AJvYcCXy0eDkjv35EH/Q34sxGj/KDB1UIjtwdCMHyMSgFhH/gpN/JI8x8I5I5X8caOVHm7t4VqUxH0Mhn9JhQRXv@lists.postgresql.org X-Gm-Message-State: AOJu0YxH4CFienyFAAKGV2IKCf7SfJFtLAPKAe5Dl+dj/PMZ0IiD/oMc nkT3U7DJBO3znzoVSNr3URyHuj+hij+i5EjOopWIBlSqKOImo7jA4AM6uvgxRe1ID9ZP9lofi5L lhcyHwXCwPVnFDGmGk6J+KsE2vN0d/2LblkxplcQy X-Gm-Gg: AY/fxX5M1ISYcicSLmynVbzlBWdxGauAoSWcP4n7gtfZ+v+mGazRFjEu1NmPgHCeCOH 9wUbQ5frMmtOi2p6plhKhQb+jXXKX4fLUK8HbUVqfDn0eqn7OznMt4wvVJnjW/eqWds4E7KOSHN S4PJdYjWluXFGJOsryVRuZd+cgeyAKNAyD1pYO34DRRaGwZGDbysDOAP0zo0zKvv4KmlfrA9D1B JF4Nukl34oFt3gBlnFGxGKtbL55hQ+e+ON1Xj3mMpbBpaJrEs34pSinCY1hs4S8X7mZedKS X-Google-Smtp-Source: AGHT+IHUbF2a79mSG+R3uYuvpSk+4fUUUd4K/+0l6tDTdtvNXl/rP3i2OEPtgRK7OwypjvcPE9ki7gM4lcEs7/bodjw= X-Received: by 2002:a05:6402:34d1:b0:636:2699:3812 with SMTP id 4fb4d7f45d1cf-650977df5e8mr1759114a12.0.1767774191033; Wed, 07 Jan 2026 00:23:11 -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: tushar Date: Wed, 7 Jan 2026 13:52:58 +0530 X-Gm-Features: AQt7F2rxJDDko3cyIjKSVifeGFmy0l8hm_f3s9h4nJHCMJ5FyVSjnTKN7BjDCUA Message-ID: Subject: Re: Non-text mode for pg_dumpall To: Mahendra Singh Thalor Cc: jian he , Vaibhav Dalvi , pgsql-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000b336970647c8009b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000b336970647c8009b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jan 6, 2026 at 11:56=E2=80=AFAM Mahendra Singh Thalor wrote: > > > > We have another thread for this. We have patches also. Last year, we > planned to block these databases at creation time. > > > > > It's probably harmless, we connect to the databases further down to do > actual work. But it's also not nice. The toc.glo seems to have a bunch of > extraneous entries of type COMMENT and CONNECT. Why is that? As far as > poible this should have output pretty much identical to a plain pg_dumpa= ll. > > > > > > cheers > > > > > > andrew > > If we don't dump those comments in non-text format, then the output of > "pg_restore -f filename dump_non_text" will not be the same as the > plain dump of pg_dumpall. > > Here, I am attaching an updated patch for the review and testing. > > Hi Mahendra, I found a scenario in which the table is not restored if --transaction-size switch is used at the time of pg_restore operation Please refer this scenario: Case A --pg_restore operation with "--transaction-size" against the dump (taken using pg_dump) - create a table ( create table t(n int); ) perform pg_dump ( ./pg_dump -Ft postgres -f xyz.tar) create a database (create database test;) perform pg_restore using switch "--transaction-size" ( ./pg_restore --transaction-size=3D1 -d test xyz.tar) table is restored into test database Case B --pg_restore operation with "--transaction-size" against the dump (taken using pg_dumpall) - create a table ( create table t(n int); ) perform pg_dumpall ( ./pg_dumpall -Ft -f abc.tar) create a new cluster, start the server against a different port perform pg_restore using switch "--transaction-size" (./pg_restore -Ft --transaction-size=3D10 -d postgres abc.tar -p 9000 -C) table is not restored if i remove --transaction-size switch then this works. regards, --000000000000b336970647c8009b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Tue, Jan 6, = 2026 at 11:56=E2=80=AFAM Mahendra Singh Thalor <mahi6run@gmail.com> wrote:



We have another thread for this. We have patches also. Last year, we
planned to block these databases at creation time.

>
> It's probably harmless, we connect to the databases further down t= o do actual work. But it's also not nice. The toc.glo seems to have a b= unch of extraneous entries of type COMMENT and CONNECT. Why is that? As far= as poible this should have output pretty much=C2=A0 identical to a plain p= g_dumpall.
>
>
> cheers
>
>
> andrew

If we don't dump those comments in non-text format, then the output of<= br> "pg_restore -f filename dump_non_text" will not be the same as th= e
plain dump of pg_dumpall.

Here, I am attaching an updated patch for the review and testing.


Hi Mahendra,=C2=A0

= I found a scenario=C2=A0 in which the table is not restored=C2=A0if=C2=A0--= transaction-size switch is used=C2=A0 at the time of pg_restore operation= =C2=A0

Please refer this scenario:
Case = A --pg_restore operation with "--transaction-size" against the=C2= =A0 dump (taken using pg_dump) -
create a table ( create table t(= n int); )=C2=A0
perform pg_dump ( ./pg_dump -Ft postgres -f xyz.t= ar)
create a database (create database test;)=C2=A0
per= form pg_restore using switch "--transaction-size" ( ./pg_restore = --transaction-size=3D1 -d test xyz.tar)=C2=A0
table is restored i= nto test database=C2=A0

Case B --pg_restore operat= ion with "--transaction-size" against the=C2=A0 dump (taken using= pg_dumpall) -
create a table ( create table t(n int); )=C2= =A0
perform pg_dumpall ( ./pg_dumpall -Ft -f abc.tar)
c= reate a new cluster, start the server against a different port=C2=A0
<= div>perform pg_restore using switch "--transaction-size" (./pg_re= store -Ft --transaction-size=3D10 -d postgres abc.tar -p 9000 -C)
table is not restored=C2=A0

if i remove --transac= tion-size switch then this works.=C2=A0

regards,
=C2=A0
--000000000000b336970647c8009b--