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 1vjHLa-00CGJS-05 for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Jan 2026 13:37:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vjHLY-00009o-2t for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Jan 2026 13:37:09 +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 1vjHLY-00009e-1Q for pgsql-hackers@lists.postgresql.org; Fri, 23 Jan 2026 13:37:08 +0000 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vjHLV-001v7k-0u for pgsql-hackers@lists.postgresql.org; Fri, 23 Jan 2026 13:37:06 +0000 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-64d02c01865so3614105a12.1 for ; Fri, 23 Jan 2026 05:37:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1769175419; cv=none; d=google.com; s=arc-20240605; b=gh24BGcaSnWMJLeveA1KrTlXmypHN8VG//ScioZ8GvA2uTxS1qZ8vTJrdUQmDoJrpe dAUKZQJWHYkNgAVZRxaCxHz7DzmH9deO+mPLMxRPQOFumpihP7+Wwn+lnjox5pPXAdjX Q9ZRGxrYyVgtRhvfHowlRfBIdaNRyrBycY+hVQVlMy6LHr1jqEPZ3IegzpwdEnERyCZq 2s4/9rXtRehdIi810BAZaInljg7YBA21F8rBK0eLJfdf3f35QtmwTp26J2RjreckrAcZ 3pkXKsKTT7LFA406EA3elx/Vj8IX9R+Lt4YL/0Am+kncMOD1YCC6JYLAvCEtNb6Ym6q8 Njqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=s8sLUYz9ZnP/rlOhlMRWrIL4/GnYgug0+qkH8j0DpiM=; fh=wXAQPpUNOiK2gwPhKh2RIpGpvy1+X9pSDKLn8So5hzM=; b=gSEGIS39xdQrNMJH0pQacIS+XQruliUaZunNi2cEEyZsNZXyFdxD7pQPwylQTj86Dx 9C2P4Y0Y0LhGQezjPKSlyLoVSqMngUPXd6thZmfsQq+9P2N7vUh4jnRmfIoAuM3jjd+p ZkhH/SkcxCXHVhJUxURmk1OfdZ2ypyDmn2XrY3r1Ui3PMZQTT+bc0HPcmNF7qPYb7pK9 yScGZ5lOxATowexbV2DbOYzmoAt55dv05FT+1rwOD+A4d/UWGmJAfaXfUjS0HWclbUr1 BBlsEAfal3H2awwNi0x4w+vKuo/AYN0rPrBryW8omuQR+ebSoRKoQsLmJDAtO0k5fB2v tVjA==; 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=enterprisedb.com; s=google; t=1769175419; x=1769780219; 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=s8sLUYz9ZnP/rlOhlMRWrIL4/GnYgug0+qkH8j0DpiM=; b=ChI/3fdxNLA/JSoYzmsfFertTHfJqc84Z9IHnkPDN2hxuyyP9DRsBhXU+rEWLHN34r ronkz91HeLKwMELPyTabWFjWwi1/z4zDA0FUoov90dNDHNG83dAtZ7hwo1/JqUXQ2OLD z5MEE1sFFqAgY6q+F3jRdvNrQ8SgrdV8qW2QQ4JZTzpaQ1yLk+92GMFHLx0kIdF1NZZR xN0ebmVDPW0eFfRGvYm9pzy9FZFS/SeaWNh1S7a/oZ8n89H+JI5pVdGxJ2oaovUPvX9E 36H4BBBwB/BaqBroXPxDjQOvIBpeUWNEGLZyAn9RbnpaH6Kmpdr3Of2SpW2suKSFqEzg P5Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769175419; x=1769780219; 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=s8sLUYz9ZnP/rlOhlMRWrIL4/GnYgug0+qkH8j0DpiM=; b=u8ox9f6XCaVZH17kpF1umD8KUBnXfiZoP+Tw4A651kppkakZGbcD+id5IaCbMJQtFE u+ntMMm6CXDqJWFnSge3xoEiEI40fUg6Hx9t+U8VmWyTi0ywUDMU2CV54RCMRuz3L9jy pmZWKNQhwvMj4I6c1mva8nvaMgJolq0CJWbLe/8fARQw4vvvZ2kNCWgOngkxKY2mIvyk HDnzdjn5bKtvVFQyNeV6iWAqjnol1aQdB+h0/LzaxhfWc0FPqkpGf+PM8U3y8C44ynpD HKn6pNHlhxh/raMv6+VJUGq2Q6ct9JTQiRSrZmHqj0ABM/mR7iT9sjD3AdHZ0x+dL0kj +S3w== X-Forwarded-Encrypted: i=1; AJvYcCWTqSVnGkviDmSTa24wAF0K7RSxmh3VVGHLV11in9fARLOVyZH35ww+Ld6e2amxM/42PhgWnMqk2EZIOai6@lists.postgresql.org X-Gm-Message-State: AOJu0YygsGqBgZHm6N6hE8wibCvbG+6sZlCQJYvqEK1MReT7W3q0zt2G 1L9dXc3P5eYwP1qxq5KDWlht5BbY1onixZvXW7j9Y8Yva5vpjc375+mosjVykesvZIKcZ9zWkO1 JL0X2bDxfyxONaPZ1jV9aLgj2t0x7wFAJsHFBhd5I X-Gm-Gg: AZuq6aLLCVAUnIFVgE3QW8cVJO9W7JPq59cQjgTGAbVRRRE2HpES5Okhaw070hDwDRq hBl1lNBUlFZNWj6vA106YeAnFFiCfEXIbf7q/yNOMhNWCJo+JdN3LyHFoyCOyTyNVIN1fBrmXoS WsQgqHPQoucFrZnCIxOMMuOxumf1hg5tRiwgtmxgWNPsFQ63k8TDjnH6I+EhW8kNqW1WEbfBF/4 1lJJaKIVcbNsB/vgBBshjFf+kXzURd8w8mTkja18YVj3cYtZ/i2Fzy/I98YZjREMypwVePDHw== X-Received: by 2002:a05:6402:5109:b0:64b:4a33:5455 with SMTP id 4fb4d7f45d1cf-658487a0a53mr2231527a12.16.1769175419338; Fri, 23 Jan 2026 05:36:59 -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: Fri, 23 Jan 2026 19:06:47 +0530 X-Gm-Features: AZwV_QgWAy09BykgNin_I1Hrxa0J9UL5ielYr9bbj4MIyPFBZtKCJxz-flc2to8 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="0000000000006a533b06490e401f" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000006a533b06490e401f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jan 23, 2026 at 12:21=E2=80=AFPM tushar wrote: > > Thanks Mahendra, a minor observation - The pg_restore output shows 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 path > 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 template1 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 ownership of template1 objects even when the target environment lacks those specific roles. *Steps to reproduce:* initdb ( ./initdb -U edb -D data) , start the server , connect to postgres 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 ( create database abc;) perform pg_restore operation ( ./pg_restore -Ft -C abc.tar/ -d postgres -p 9033 -U xyz) --getting an error, table 'test' will be created on 'template1' database but failed to create on an another database ( in this case - 'abc' database= ) regards, --0000000000006a533b06490e401f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Fri, Jan 23,= 2026 at 12:21=E2=80=AFPM tushar <tushar.ahuja@enterprisedb.com> wrote:

Thanks Mahendra, a minor=C2=A0 observation -=C2=A0= =C2=A0The pg_restore output shows a double slash in the map.dat path (e.g.,= abc.tar//map.dat).=C2=A0
While it doesn't break the restore,= we may want to clean up the path joining logic.

[= edb@1a1c15437e7c bin]$ ./pg_restore -Ft -C abc.tar/ -d postgres -p 9011 =C2= =A0-U =C2=A0ed -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=C2=A0 created under templat= e1 and the postgres database by a specific user are failing during a cross-= cluster restore.=C2=A0
When restoring to a new cluster as a diffe= rent superuser, pg_restore throws the error: ERROR: role "edb" do= es not exist.=C2=A0
It appears the restore is attempting to prese= rve the original ownership of template1 objects even when the target enviro= nment lacks those specific roles.

Steps to repr= oduce:
initdb ( ./initdb -U edb -D data) , start the server ,= connect to postgres and=C2=A0 template1 database one by one and=C2=A0 crea= te=C2=A0
this table ( create table test(n int); )=C2=A0
perform pg_dumpall operation ( ./pg_dumpall -Ft -f abc.tar)=C2=A0
initdb (./initdb -U xyz) , start the server , create a database ( create = database abc;)=C2=A0
perform pg_restore operation ( ./pg_restore = -Ft -C abc.tar/ -d postgres -p 9033 -U xyz)
--getting an error,= =C2=A0 table 'test' will be created on 'template1' database= but failed to create on an another database ( in this case - 'abc'= database)

regards,
--0000000000006a533b06490e401f--