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 1vtRDZ-007hmC-0y for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Feb 2026 14:10:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vtRDY-008A9I-0k for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Feb 2026 14:10:52 +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 1vtRDX-008A96-2w for pgsql-hackers@lists.postgresql.org; Fri, 20 Feb 2026 14:10:51 +0000 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vtRDU-00000000OGU-3M5b for pgsql-hackers@lists.postgresql.org; Fri, 20 Feb 2026 14:10:51 +0000 Received: by mail-qt1-x835.google.com with SMTP id d75a77b69052e-506c00df428so18920481cf.3 for ; Fri, 20 Feb 2026 06:10:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771596648; cv=none; d=google.com; s=arc-20240605; b=UuEOROxOxs+qWkvaX4bELCvq/8neASJDIq9Ch3OG9sJiWgcJKDWe+f53iEorzAZgRE B20cstJCdWaeNMMt3LZl5MrOgHuxHh0Rt3w25vLX3sF5Rc1BN/H93pWYPtPahf2iFLFD Ya9r419uTqZS7/wNtBdumgNdROy4CVaXMGJH36PunJ9mpNnwzWkF4h7onK+Rkrdzr+ad G6ybDIUce0LewyOhCRzVK3CDM7AuPRnT65SOd6J9ICQOYRjrul7hfo9kBZEcP/QOp3uj LBnUX9zsfxBLIjk+6+jUPXEfTZiJ5razQc6xEgFz1azcM1jtdS+6zwypP9YVC0I1Sarb VBbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Sw5v/DPaJQQK8QLAW59OP3tMUlDo3RE3MMHZFUApsgg=; fh=OZJaIIUg4+pnKnCWnq4AHW33w1/Y+aBy4VVCLwVI4DY=; b=ly/SoFcL+K8Ryrpl3lThF4yUnFK8N+ytGxKnAR+y9CrUNbS77y8GudtYVtFA6kGAFH g5kNVlLx3NXpwGGh6Jzfgtj49BtrlSOt63v3KkYsOSTQcoIGCbG57G8W/jEyqhDXyv/1 g8JpQVkcy0/tb+RQdsuVynlJzd0xHR3cbm+7TwF03keiu9YAwcYvm2vW/GkLjog238uY QBlsPapIoqVMOZ++6lrcUm5smY2aqwm1ODI7m3FaBxtHfd0FYISon6g9opxTYc2nETZi ZL2qfM5E76+WtY+AbNAPnNSeozYAZC3IcZNaJHnaoudo8QbDzhjiMR6rXXNqYv8v7/ga 70ZA==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771596648; x=1772201448; 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=Sw5v/DPaJQQK8QLAW59OP3tMUlDo3RE3MMHZFUApsgg=; b=MWy5p6nwjnAkr6q3uCq++trez19pBCGMmYpfjFzPcYQzxeLE5jW10tkWVTgCH3ITP6 xr9ODp9Z9eg99y+ZKGwME7g6EKdhgG25P0ESCV1jmWXl1oTF8URT6KtZtBtFn7ZRqmU5 IPlm32dKmu1EpTFVkc9OiUBR0jC6hoIKqUube1/aPDRkB5UZ1zLxPbETohw83CqJZJGQ W94XKpC1SMVr+QIXxIiRH9CNCXOs753WfXm2trRFJLx5jriorvfpSKYsWgJq2a7xTiMX 1erWHy/Rmu0+DPc1uDi9jdP7+RvWSW/kM/Xm6zbGadpjpslKNRx5lIIZskx5trw7q4Nv OMnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771596648; x=1772201448; 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=Sw5v/DPaJQQK8QLAW59OP3tMUlDo3RE3MMHZFUApsgg=; b=jhGeA5iYQwkJ9aSA4nal8nAvfpjHBbBSPjN5GuzGFqPmB2It9/GjDjO7wBrkxsDVGb 10EPruAKVPdCt0/BzXg2enldRgHKkZzyvz29C6veyIcoTHK80dGQ9qgy5eaEt259F63i JpVp52KnF5N03Hm/rQi4ZtZqbv3OhapsupoN2EcESEMRfovHMfMaPB1U4ywPW7n4QWfi n8m23VoqSoy2guDa65knSPQv3q2+gSK/FhEGKnvdbhDnfv4Xz9OjE0SOs3buWQIBbTIz F0ZKt1TC06VGg3zuEgcto5LyVf6TKs6zSbk0I//VhKXKNY1icm/Qyh08SQIY17dfFkpo HCHQ== X-Forwarded-Encrypted: i=1; AJvYcCUwwfys4TiD0NIfhIEp8I8aiYwmjDCS2V+MfTi2ZveNU37hbRA/L3J2KOgxv6+xsGIPDgEAdtl0mHtWifZH@lists.postgresql.org X-Gm-Message-State: AOJu0YyErKI0QqE+NAmOIoAVqdSyGcQHTpEMPJ15tlJuF5S1qf6QFqSs luSmdGkNRuIhiJwJAGe9yE6LMywx6GE+at9BXa6d3OrKfmipqbqfgBCMD9qGQQZI6IaKaAuuYJL hUCpM6uIIRwE4uwZ3W3DZNERUc5Fg5qw= X-Gm-Gg: AZuq6aIJWzt8cODBjUNX0CtqFpOqTMJiqlJ7X6VW6qKRNUuz+q63G6h8EuLBEQBM9NL sKoO629iN8uvJqbqNZjHYnEIl9MgX6hkOQe8+otZmNpVi7OmnnsvGxOaA1Puo4WlrfEleh4ssiY goA5m4IE8DgyhtDw0LVOlDFIPEjUCk6y/i6MkmM2I6CMzkyeXWCEX4PfetShJYK22DH6wptu0YI xonGF4F0wofG5nRAoW7dhIXEIXxiQ9UbPoAZwdVADNAy0XgqpwVwzCAycOmdDVrkXb+/WZpqhk/ g1Xm+j4Z X-Received: by 2002:ac8:5fd5:0:b0:4e8:baad:9875 with SMTP id d75a77b69052e-506e916bc0dmr114713321cf.4.1771596647867; Fri, 20 Feb 2026 06:10:47 -0800 (PST) MIME-Version: 1.0 References: <3f22a8bb-29e8-40cc-97a1-309181da2c13@dunslane.net> <4022765f-38ee-48a3-b246-615b3f8e1c23@dunslane.net> In-Reply-To: <4022765f-38ee-48a3-b246-615b3f8e1c23@dunslane.net> From: Mahendra Singh Thalor Date: Fri, 20 Feb 2026 19:40:36 +0530 X-Gm-Features: AaiRm53S_H7QimwYHcLVCafFAUJ1cAXKq2LCOsY76kzjYsQ7QcMEuXZqPJLqt5Y Message-ID: Subject: Re: Non-text mode for pg_dumpall To: Andrew Dunstan Cc: tushar , jian he , 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 Fri, 20 Feb 2026 at 01:30, Andrew Dunstan wrote: > > > On 2026-02-18 We 12:15 AM, Mahendra Singh Thalor wrote: > > On Wed, 28 Jan 2026 at 13:04, tushar wrot= e: > > > > > > > > On Tue, Jan 27, 2026 at 9:11=E2=80=AFPM Mahendra Singh Thalor wrote: > >> > >> On Fri, 23 Jan 2026 at 19:07, tushar w= rote: > >> > > >> > > >> > > >> > On Fri, Jan 23, 2026 at 12:21=E2=80=AFPM tushar wrote: > >> >> > >> >> > >> >> Thanks Mahendra, a minor observation - The pg_restore output show= s a double slash in the map.dat path (e.g., abc.tar//map.dat). > >> >> While it doesn't break the restore, we may want to clean up the pat= h joining logic. > >> >> > >> >> [edb@1a1c15437e7c bin]$ ./pg_restore -Ft -C abc.tar/ -d postgres -p= 9011 -U ed -v > >> >> pg_restore: found database "template1 > >> >> " (OID: 1) in file "abc.tar//map.dat" > >> >> pg_restore: found database "postgres > >> >> " (OID: 5) in file "abc.tar//map.dat" > >> >> > >> >> > >> > > >> > Please refer to this scenario where - Objects created under templat= e1 and the postgres database by a specific user are failing during a cross-= cluster restore. > >> > When restoring to a new cluster as a different superuser, pg_restore= throws the error: ERROR: role "edb" does not exist. > >> > It appears the restore is attempting to preserve the original owners= hip of template1 objects even when the target environment lacks those speci= fic roles. > >> > > >> > Steps to reproduce: > >> > initdb ( ./initdb -U edb -D data) , start the server , connect to po= stgres and template1 database one by one and create > >> > this table ( create table test(n int); ) > >> > perform pg_dumpall operation ( ./pg_dumpall -Ft -f abc.tar) > >> > initdb (./initdb -U xyz) , start the server , create a database ( cr= eate database abc;) > >> > perform pg_restore operation ( ./pg_restore -Ft -C abc.tar/ -d postg= res -p 9033 -U xyz) > >> > --getting an error, table 'test' will be created on 'template1' dat= abase but failed to create on an another database ( in this case - 'abc' da= tabase) > >> > > >> > regards, > >> > >> Hi, > >> Here I am attaching an updated patch for the review and testing. > >> Thanks Jian for the reporting rebase issue. > >> > > > > Thanks Mahendra, getting a regression error during the restore process = after applying this patch. > > > > [edb@1a1c15437e7c bin]$ ./pg_restore -Ft -C abc1.tar/ -d postgres -p 9= 000 > > pg_restore: error: could not execute query: ERROR: non-standard string= literals are not supported > > Command was: SET standard_conforming_strings =3D off; > > pg_restore: warning: errors ignored on restore: 1 > > > > in earlier patches - this was not coming. > > > > regards, > > > > Thanks Andrew for some design related feedback. > > Thanks Jian for the offline discussions, reviews, testing and delta patch= es. > > Thanks Tushar for the detailed testing. > > Brief about this patch: > new option to pg_dumpall: --format=3Dd/t/c/p directory/tar/custam/plain > > If the user gives a non-text format with pg_dumpall command, then the ful= l cluster will be dumped and global objects (roles. tablespaces, databases)= will be dumped into toc.glo file in custom format with drop commands and d= atabases will be dumped into a given archive format one by one with oid.tar= /oid.dmp/oid files/dir. > When restoring, if the user gives -g(globals-only) option, then creating = commands of only global users/tablespaces/databases will be restored. (no = drop commands will be executed) > toc.glo will be executed with -e(exit-on-error=3Dfalse) and --transaction= -size=3D0 as some user already created. If the user wants to restore a sing= le database, they can restore it by a single dump file. For --clean and -g(= globals-only), we added some error cases so that roles/databases/tablespace= s will not be dropped. > > Here, I am attaching an updated patch for the review and testing. > > > Here's an update after a round of review. Most of the changes are pretty = minor, but it should get the cfbot all green, with a Windows fix in the tes= ts. > > > cheers > > > andrew > > > -- > Andrew Dunstan > EDB: https://www.enterprisedb.com Thanks Andrew for the updated patch. Updated patch looks good to me. I have verified by some dump/restore testin= g. --=20 Thanks and Regards Mahendra Singh Thalor EnterpriseDB: http://www.enterprisedb.com