Thanks Tushar for the testing and reports.

On Tue, 2 Dec 2025 at 18:45, tushar <[email protected]> wrote:
>
>
>
> On Mon, Dec 1, 2025 at 10:47 PM tushar <[email protected]> wrote:
>>>
>>>
>>
>> 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.
>>
>> --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=# create table t(n int);
> CREATE TABLE
> postgres=# insert into t values (1);
> INSERT 0 1
> postgres=# comment on table t is 'testing...';
> COMMENT
> postgres=# 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=# 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=# 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,

I tried to fix these issues in the attached patch.

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

-- 
Thanks and Regards
Mahendra Singh Thalor
EnterpriseDB: http://www.enterprisedb.com

Attachment: v11_08122025-Non-text-modes-for-pg_dumpall-correspondingly-change.patch
Description: Binary data

Reply via email to