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 1vl04L-005YW1-2y for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Jan 2026 07:34:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vl04K-000L0k-2G for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Jan 2026 07:34:29 +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 1vl04K-000L0V-18 for pgsql-hackers@lists.postgresql.org; Wed, 28 Jan 2026 07:34:28 +0000 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vl04H-00000000qDx-2Vqu for pgsql-hackers@lists.postgresql.org; Wed, 28 Jan 2026 07:34:27 +0000 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-64b9dfc146fso1058805a12.0 for ; Tue, 27 Jan 2026 23:34:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1769585663; cv=none; d=google.com; s=arc-20240605; b=BtWH70fyUqgHhSHBOnk/QXtXna4rO/T6wLkRjBtvTSu0Amb6UfFCYYQ9vlmLTLA3ch WvXtaI0iAna1KX8hjoNiYQymHlZkXz/vO3Ik607nGQBp3eLiRdobjm3e+I/9uHQsa4Pr OLhQIYDC/fFXMyta4I6pSt92oQ4iN227kaSsfzb+e2iNXfDkMflHiJlCz7uJuPniwtnN aBruPxB7th4PfkKboU/1fsXEbQN3Hg9inhKyZaHTi9IYrEz6/koRHInuopuGScwn39Na kz+tJwxxzcNx3RVoONvmf0el/zwYyxn7LFlRhx7fCU0ZPy9h39IfQzproUOjYFaW+KZ4 DdNw== 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=iN4x2evSU9ChEVCobGlGkJLysZuEnYE3o2kdYAvveps=; fh=9WG2p+xVNa24qu/xqL9lhllgRveINnayXI+mudicE+c=; b=WVfPAA3Ieii2RqBTAFS7xJLm1Enr/+QcRiyPj4hxjO5xwv+H8UZJaIV7LrFHc7A05L gyZPGKe/5BhZ3tyeQvVH17w00MtmsZfrszgWWvKgCPQP8lEj5U2aAxSamNUTYV3cZbt8 OdF+uaWQsgw5/1S8NtFtsKzV/aU4TajsihPelgHqoo3XHPTCHjPRV0X4WMDttU/3rW41 Qn5aypPw8LQ7FgOF5pf8QLGrT1ObIS0sGUCA5QPaD45yZHcI33yJ25lFngIbtS63Ebth CgGsUQjODkg9lon+XSvoBW2x9K/CddTcGHwXcCiqWXHshUKUJdlg6SJTBy3fvaicVp6B BSXw==; 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=1769585663; x=1770190463; 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=iN4x2evSU9ChEVCobGlGkJLysZuEnYE3o2kdYAvveps=; b=ZAAmmXxRw781JqFy3p5ROyJxZoVMX6EE1ehdAC1r4TQXal5pBymjdUN9K4r9VwkGOK 8HhGxhARd2kC0hWdMonNaX7T43A+c/nEjfOTOpkeHfs68Gv5WWsc6ubJEThLvonjKr6F TDPbEnOeVVNu/T4fN0DCH8KI23YQB+M7AzxZAV6KJEjrABxy6AGTDyIpJ1A7j8nGhM6v TyvbwE2tMURl/blR4DiVbCLEWqXODL/mPqIxyB6FoI/VFrjkeEswAsaf09RDlUtbFN2Y ZmsIichcXPrAcFhm36xmYM3DpbWBtY3BZHzjg5MFVAsNNpWoumdEHWxdBOX3fVGJFWU4 u9ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769585663; x=1770190463; 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=iN4x2evSU9ChEVCobGlGkJLysZuEnYE3o2kdYAvveps=; b=YjIFMP+02GKoKIDGN9+KHM3wZX1CUJEY9J9Zjt2H3ZcjfpO8Ept5kLaejstLGPbxrQ tWnj63WVZNN59lznHtB+XxtrDwoysKnEf1IVtz4cOVzQVfT2dWAXPbq1gtzDDtreL5Ci YRnSkoFFMektvRphhtvAjVtao0qvt3AKqmtD15cJG0hOVk4FBny0g+4Cf9OWelRJOC05 vtQrrxLZ1yJ0vA6P9IWB0Vn1ObhuUersP2g3W6Mu9rSWosd4NoocQC753ZwqSetCQ4yK xfhFSHmnl/IByMjPGmgPoz5nBlPc4YuXQj4FvRaf13WDRmbuAYJDHoHON4tY1QPxtO9d 1kvg== X-Forwarded-Encrypted: i=1; AJvYcCWUWoaEutXXy1MpRzfOpPLoy+RpyKjLcVov9iRiDnL5HZjMHlKinsYdIRR4qXM6kIqYzWTOddiTNldE8C0j@lists.postgresql.org X-Gm-Message-State: AOJu0Ywec0+4qorF1XmYEvEPXneZTpxgI49oKq8G4Ul01IEZbK9QbyWI fdncfAkJGb5QRsHWPgNY/pFGc3AfkyyftHcahzXsG/P0mEPgEwA8DvyKEqyZikG3szMf8YBeqY8 lRareeneGdXKK7iT9mFiYhZQfWJ1dBoKZ4ID8Do8U X-Gm-Gg: AZuq6aIIfZkSKKaFKA+FAFrYweEL6r9UTLcyG7/S9oaajkfLOH4kda9y2My2HybTnI5 AMDi4y2SAgA9601v959xteJJ0cnQ9MnbSbCWNRyjxnTgLseKgJ2TVpi1RQ4wZ9VpC0Hl+Tg0IiW dvZvaIksJwqiZsXWBdUc5boD9xbNosKjoROsJToAg/E8K6Os9odR9r4bANYIz3xPIqClP9YMhDl mf2twA3GF3f7TNS82BK4waiViPu2Kx44Sr18SvglQTRN5R5xLapHbXsQCnfK5bNnAR+yUSc X-Received: by 2002:aa7:cd44:0:b0:658:1350:1fd2 with SMTP id 4fb4d7f45d1cf-658a72bf0fdmr1793568a12.13.1769585663014; Tue, 27 Jan 2026 23:34:23 -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, 28 Jan 2026 13:04:11 +0530 X-Gm-Features: AZwV_QhkEymIxeqBU7FNcYMXQs3xwlqENZ34-w5R0QAt7ZsPQywt0ivuKG3kzQ0 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="000000000000d80be706496dc4ef" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d80be706496dc4ef Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jan 27, 2026 at 9:11=E2=80=AFPM Mahendra Singh Thalor wrote: > On Fri, 23 Jan 2026 at 19:07, tushar > wrote: > > > > > > > > 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 specifi= c > 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 ( creat= e > 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 - 'ab= c' > database) > > > > 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 9000 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, --000000000000d80be706496dc4ef Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Tue, Jan 27,= 2026 at 9:11=E2=80=AFPM Mahendra Singh Thalor <mahi6run@gmail.com> wrote:
On Fri, 23 Jan 2026 at 19:07, tushar <<= a href=3D"mailto:tushar.ahuja@enterprisedb.com" target=3D"_blank">tushar.ah= uja@enterprisedb.com> wrote:
>
>
>
> 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 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 th= e path joining logic.
>>
>> [edb@1a1c15437e7c bin]$ ./pg_restore -Ft -C abc.tar/ -d postgres -= p 9011=C2=A0 -U=C2=A0 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=C2=A0 created under temp= late1 and the postgres database by a specific user are failing during a cro= ss-cluster restore.
> When restoring to a new cluster as a different superuser, pg_restore t= hrows the error: ERROR: role "edb" does not exist.
> It appears the restore is attempting to preserve the original ownershi= p of template1 objects even when the target environment lacks those specifi= c roles.
>
> Steps to reproduce:
> initdb ( ./initdb -U edb -D data) , start the server , connect to post= gres and=C2=A0 template1 database one by one and=C2=A0 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 ( crea= te database abc;)
> perform pg_restore operation ( ./pg_restore -Ft -C abc.tar/ -d postgre= s -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 t= his case - 'abc' database)
>
> 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 pro= cess after applying this patch.

=C2=A0[edb@1a1c154= 37e7c bin]$ ./pg_restore -Ft -C abc1.tar/ -d postgres -p 9000
pg_resto= re: error: could not execute query: ERROR: =C2=A0non-standard string litera= ls are not supported
Command was: SET standard_conforming_strings =3D of= f;
pg_restore: warning: errors ignored on restore: 1=C2=A0

in earlier patches - this was not coming.=C2= =A0

regards,

--000000000000d80be706496dc4ef--