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 1vQQE1-0078wp-08 for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Dec 2025 13:15:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vQQE0-007pLe-0D for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Dec 2025 13:15:24 +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 1vQQDz-007pLW-21 for pgsql-hackers@lists.postgresql.org; Tue, 02 Dec 2025 13:15:24 +0000 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vQQDw-002kax-0F for pgsql-hackers@lists.postgresql.org; Tue, 02 Dec 2025 13:15:22 +0000 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-6418b55f86dso9817485a12.1 for ; Tue, 02 Dec 2025 05:15:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1764681318; x=1765286118; 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=IKf4lajl/W9pi/kMLmr8tUjIWE4CKM5Ha/LmNy+cEXk=; b=QkyoXnzC3AMsv+LfBgEDOT2o39wq3laxLFhEuxI0HshCjwJr5MAaY4ltIeZbrOrJ0f I+5cRhq/9qTk9icR/isPTcB0Z8k9LYyY1Y/hIcdGbW1QgchzmWA8FwkWoAEF05ZnzFWw VJ6EPoO2t49XqgJkq/WDi0y0upF0KWkSNg/tbC2ZAhvmag6Ej73+FV+PYflcXBVEPDSC J18AofXsNWGGbXd86ppTYOKHATrdxpuw8lDxt6vVqkjrLlX/wWOCN4SxeFQr6ZKfzsTB 29tDg+j5w7WF3P/mFuXSqNKVWahg6i+/sb4YKqUFHNiffAUD9cZxDQEVHx6eBPYMBgNr bYzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764681318; x=1765286118; 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=IKf4lajl/W9pi/kMLmr8tUjIWE4CKM5Ha/LmNy+cEXk=; b=KEsvD5CbHp6lYM/b5OHbM1Fl2azoudO1ziY+vNwHawmjcz4lr550gmPtqqaraZ80G2 NN4Oary9aA8/MWcO7ayNrxB6H+Y18obPdIp0tUEn2TOwmHZ95MpVQdcp4UAWY1tPtyNJ mxl2o1c84Dd9+YRI2QRvHbGs/dEHgrnzmOt7TSmWHq0G9ZdtotyQbBIgsXOZMs8WMelr BDtOnTxErJuq1wslgbHVet9EMJU7pmDfFWqHbLYEJVQUBhGGWP8YNMbXF7qfWa+wgEjF rx+pElrvxtH7imHlnQHGTB9oWr5nbm/r57iy9SngA6g9YqmX81LuvX4Ay1VmD/pmrJ/3 pi8Q== X-Forwarded-Encrypted: i=1; AJvYcCVc+LPPBfX5frTNzDn9dMzuVZmqh7S70OmazQMKA9ElScGHWIhWJkd6R8ceXtnC2Mo5vbQFuFcGSY5IKXE/@lists.postgresql.org X-Gm-Message-State: AOJu0YwshdEWXVVlUahLEL+2rcfyxu68iGMGIWZlMQh2l6givRYw7Pj7 rElDB+tvvuuJEBcd+uLarLO/x9it9t3m6GlhBJU2xsdZnhKFOs2hFXbSS/gu35fK/VVQx7ZFxxB bocwMBw0bOl+1sN/97D3d3ygKlj4t3Lg7H2tGcHr6 X-Gm-Gg: ASbGncvEUYg+aYl7C6Pub3uhiZI+8MFHoQTi0KlDTqo+yXeNeeLrHA1cfN+q3714OyZ AJI3a8QH7HrvYYVc1RcgcfueGJJW8ncaJjGj/ibohpHbbtrtMy+cSmM22ztEqMOI/lkK8otzPcz I8NMWWhEF831ZxZ2d7oGLZXTwhP2ujz+O3XQTzYZYhMuzHSLDovuN9x4Nymj/Gl4p6nKoQMdq2Z qZxWa4uek1nSBoMvUooUifcbbdVCER/i9xWxUwlJyYb0+JI4rvtfTHHg+PPMzgpGd3Xon/Q X-Google-Smtp-Source: AGHT+IEzUVLrfP7J4Kyn8MAu94EZyMOK/YXHoOTCELxMoTgBCglfYW5rcrhriUpc/2l4gRbaNcwt0hfjjPSIAgjxgOo= X-Received: by 2002:a05:6402:26c3:b0:63c:2d72:56e3 with SMTP id 4fb4d7f45d1cf-6455469be57mr34283569a12.23.1764681317810; Tue, 02 Dec 2025 05:15:17 -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: Tue, 2 Dec 2025 18:45:06 +0530 X-Gm-Features: AWmQ_blt_5zrarXN6R5s1t3VXXY0MmkDZeHQvkMfw-M8CSUSDMv7sdY6jFa7dBg Message-ID: Subject: Re: Non-text mode for pg_dumpall To: Mahendra Singh Thalor Cc: Vaibhav Dalvi , pgsql-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000001711a90644f7e388" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000001711a90644f7e388 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Dec 1, 2025 at 10:47=E2=80=AFPM tushar wrote: > >> > I have observed that when combining the --globals-only option with certai= n > other switches during a pg_restore - operation fails silently. > The attempted restore does not execute, but no error message or warning i= s > displayed unless the --verbose option is also used. > > --this will just run without any message but objects also not going to > create > ./pg_restore -Fc ok31. -C -d postgres -t mytable --globals-only > ./pg_restore -Fc ok31. -C -d postgres -no-tablespace --globals-only > ./pg_restore -Fc ok31. -C -d postgres -no-data --globals-only > > with --verbose > [edb@1a1c15437e7c bin]$ ./pg_restore -Fc ok31. -C -d postgres -t myable > --globals-only -v > pg_restore: connecting to database for restore > pg_restore: executing SELECT pg_catalog.set_config('search_path', '', > false); > pg_restore: implied no-schema restore > pg_restore: database restoring skipped because option -g/--globals-only > was specified > > we should probably add some message there. > > Please refer this scenario where "--no-comments" switch is ignoring when used with -Ft/c option of pg_dumpall *Test Case to reproduce:* --Connect to psql terminal , create a table and comment : postgres=3D# create table t(n int); CREATE TABLE postgres=3D# insert into t values (1); INSERT 0 1 postgres=3D# comment on table t is 'testing...'; COMMENT postgres=3D# SELECT obj_description('public.t'::regclass, 'pg_class') AS table_comment ; table_comment --------------- testing... (1 row) --perform pg_dumpall with (a) -Fp (./pg_dumpall -Fp --no-comments -f dump.plain) (b) -Ft (./pg_dumpall -Ft --no-comments -f dump.tar) Case 1: restore (a) , just run the file (dump.plain) on psql terminal , fire this query : postgres=3D# SELECT obj_description('public.t'::regclass, 'pg_class') AS table_comment; table_comment --------------- (1 row) Seems expected . Case 2: restore (b) via command ( ./pg_restore -Ft dump.tar -d postgres -p 5806 -C ) fire this query : postgres=3D# SELECT obj_description('public.t'::regclass, 'pg_class') AS table_comment ; table_comment --------------- testing... (1 row) Seems not expected i.e pg_dumpall with option -Ft still taking table comments and ignoring --no-comments switch. regards, --0000000000001711a90644f7e388 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Mon, Dec 1, = 2025 at 10:47=E2=80=AFPM tushar <tushar.ahuja@enterprisedb.com> wrote:
=

=C2= =A0
I have observed that when combining the --globals-only option= with certain other switches during a pg_restore - operation fails silently= .
The attempted restore does not execute, but no error message or= warning is displayed unless the --verbose option is also used.
<= br>
--this will just run without any message but objects also not= going to create=C2=A0=C2=A0
./pg_restore -Fc ok31. -C -d postgre= s =C2=A0-t mytable=C2=A0 --globals-only=C2=A0
./pg_restore -= Fc ok31. -C -d postgres =C2=A0-no-tablespace =C2=A0 =C2=A0 --globals-only
./pg_restore -Fc ok31. -C -d postgres =C2=A0-no-data =C2=A0--globa= ls-only

with --verbose
[edb@1a1c15= 437e7c bin]$ ./pg_restore -Fc ok31. -C -d postgres =C2=A0-t myable=C2=A0 --= globals-only -v
pg_restore: connecting to database for restore
pg_res= tore: executing SELECT pg_catalog.set_config('search_path', '&#= 39;, false);
pg_restore: implied no-schema restore
pg_restore: databa= se restoring skipped because option -g/--globals-only was specified

we should probably add some message there.=C2=A0


Please refer t= his scenario where "--no-comments"=C2=A0 switch=C2=A0 is ignoring= when used with -Ft/c option of pg_dumpall=C2=A0=C2=A0

=
Test Case to reproduce:
--Connect to psql terminal , = create a table and comment :=C2=A0
postgres=3D# create table t(n int);=
CREATE TABLE
postgres=3D# insert into t values (1);
INSERT 0 1postgres=3D# comment on table t is 'testing...';
COMMENT
<= div class=3D"gmail_quote gmail_quote_container">postgres=3D# SELECT obj_des= cription('public.t'::regclass, 'pg_class') AS table_comment= ;
table_comment
= ---------------
=C2=A0testing...
(1 row)
=C2=A0
--perform pg_dumpall with= =C2=A0
(a) -Fp=C2=A0 =C2=A0 =C2=A0 (./pg_dumpall -Fp --no-comment= s -f dump.plain)=C2=A0
(b) -Ft=C2=A0 =C2=A0 =C2=A0 =C2=A0(./pg_du= mpall -Ft=C2=A0 --no-comments -f dump.tar)=C2=A0

C= ase 1:=C2=A0 restore (a) , just run the file (dump.plain) on psql terminal = , fire this query :
postgres=3D# SELECT
=C2=A0 =C2=A0 obj_desc= ription('public.t'::regclass, 'pg_class') AS table_comment;=
=C2=A0table_comment
---------------
=C2=A0
(1 row)
= Seems expected .

Case 2: restore (b) via command (= ./pg_restore -Ft dump.tar -d postgres -p 5806=C2=A0 -C )
fire th= is query :
postg= res=3D# SELECT obj_description('public.t'::regclass, 'pg_class&= #39;) AS table_comment ;
table_comment
---------------
=C2=A0testing...
(1 row)

Seems not expected i.e pg_dumpall wi= th option -Ft still taking table comments and ignoring --no-comments switch= .=C2=A0

regards,=C2=A0
--0000000000001711a90644f7e388--