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 1vU3Nc-00G5Wh-2z for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Dec 2025 13:40:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vU3Nb-0086TT-2f for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Dec 2025 13:40:20 +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 1vU3Nb-0086TJ-1U for pgsql-hackers@lists.postgresql.org; Fri, 12 Dec 2025 13:40:20 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vU3NY-000LaW-1q for pgsql-hackers@lists.postgresql.org; Fri, 12 Dec 2025 13:40:18 +0000 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-64312565c10so2069999a12.2 for ; Fri, 12 Dec 2025 05:40:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1765546815; x=1766151615; 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=az2wbXij8NQSD2UG1qShxhTzda6MI7aeinSZASOL24w=; b=ey9R5iNDXd/v58gLkBoVDznb7sfNWDM464PBV0HMglx2+92d6caN3AeQXDeYlncM4J 27FzPm4o7mvNxMNDn7iJQV60zyYC2Bi9CM5s3IBREUcKw5w4huLc7kR+K79R4blGfElb WU//9GZtWXLoUUScTCJYqVeEyLQEB5/ulzEDo9SzGf9zLz4VtZKXHwUOqnGhqpRPcNQ0 9HqkSAyHB7m6Wgf7h92fPLscp4p6FqP85iS5WirY99OAKod6/f31hdZgfpbHioEdKrwf 9kcWAKjHlm/vS+4kfyGUhO4ptTUXmaYdz2kKM5SoxAoPE2xk6Te6W4nsK6sxiegGOhOt mXvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765546815; x=1766151615; 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=az2wbXij8NQSD2UG1qShxhTzda6MI7aeinSZASOL24w=; b=RLp5JMLRAlwMWx0pd9arSvdwftqv8hkfn4KhFDmikSTParicG9Fv+HKqsYglVWNXLG uqj7olswKD9lafKArfRvxpfm2s+pLhMERv4IseijONUWchuUv0npEJJnxq2Yeavzvevs Fybrv2FQEiZWCLeP1Dokfz3ka/JcRwPV6YwC65KnAuwvbHIgDBhfEM3RitF1iWCRt7Kc des24yrdGnUK3IswMDRJhsJpz27VOukmbBp/mXhz4XUh7/+6dQYJc+FvowSNxV10ASgb 9LwC9bur23bbHNdeZjE3C5rkvMD9nuLTJ9ANELnWUqWejwVTzYh5AniseeHL3kG7JJtJ HsBg== X-Forwarded-Encrypted: i=1; AJvYcCXJ6PY9Qae9NX8SNcqCfNj3vZD1Jt9liHhlSICCb8ruWJ1RUxHZfcSI/nz7fOMh+jVAMjfnmqWDMOVW4Ih2@lists.postgresql.org X-Gm-Message-State: AOJu0YwnxAtLdocTio3juem+yi1jY9lWnTrtckzbl1ni8erZZYegHeve luTvfXMnt0oowh89JQtBEF0Oc8ULlT0dSuor8xz5rodBJNWPSYweneu7RjstaESBSrqGL+c5xxS R2LW9E+nscaGKVPdEq/YxZmQx2ahXrrEqdALkJ4HP X-Gm-Gg: AY/fxX68B3ex0jrepyLYa2hxweBjP1pkeY9IJqtRhKk2UG2QWUF2AqArkJRUtVto1lQ le5EUuFdg0Hiy/ao419ytW2nfERYxfVW99UmFx57rYpNsyeo1kyle0WrNAB3TaLPWQKP1F0RANT mk6NdLoIFpQfT685UkIpXE38dJ5yMZ7uQriw0VZVQsPev4FmPFoDIqvKgx51UIp4BdAF5KL8vUy PAWdLJPaXd/yHlazeMs1DPLRN4mdQS2/cj0DFop3t8y5sb9GPSbFZegaUxzXD3GP8uOWioE X-Google-Smtp-Source: AGHT+IF/hcqXSeZ3wYMh3/AtpjZ4StKx3U1UsFc5fF9cs1fZZmeAReMI4TtJKtNQUcLE17hOclqYS2393ObSGqRqiWw= X-Received: by 2002:a05:6402:35d0:b0:640:c3c4:45fd with SMTP id 4fb4d7f45d1cf-6499b11810emr2089509a12.5.1765546814846; Fri, 12 Dec 2025 05:40:14 -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, 12 Dec 2025 19:10:02 +0530 X-Gm-Features: AQt7F2o15Fkgja89u502gdhYDqi6xmKkFmiUP0sLPg9_XS61aCuo0mfIUWtMWTo 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="000000000000bbc9b50645c1663b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000bbc9b50645c1663b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Dec 11, 2025 at 9:39=E2=80=AFPM Mahendra Singh Thalor wrote: > > > Here, in our case, as the cluster already has a role with the current > user in restore, we are reporting error "pg_restore: error: could not > execute query: ERROR: role "role" already exists" and after this > error, restore is exiting. > > If you restore using a different role, then you will not get any error > and the full cluster will be restored. I will add some handling to > ignore the "CREATE ROLE current_user" command in pg_restore. > > Thanks Mahendra, Could you please also add some error message for this below pg_restore command: postgres=3D# create table t(n int); CREATE TABLE postgres=3D# insert into t values (1),(10),(100); INSERT 0 3 Perform pg_dump: ./pg_dump -Ft -f a.a1 postgres Perform pg_restore: /pg_restore -Ft a.a1 -f -C -v pg_restore: creating TABLE "public.t" pg_restore: processing data for table "public.t" [edb@1a1c15437e7c bin]$ ./psql postgres psql (19devel) Type "help" for help. postgres=3D# \dt Did not find any tables. postgres=3D# regards, --000000000000bbc9b50645c1663b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu, Dec 11,= 2025 at 9:39=E2=80=AFPM Mahendra Singh Thalor <mahi6run@gmail.com> wrote:


Here, in our case, as the cluster already has a role with the current
user in restore, we are reporting error=C2=A0 "pg_restore: error: coul= d not
execute query: ERROR:=C2=A0 role "role" already exists" and = after this
error, restore is exiting.

If you restore using a different role, then you will not get any error
and the full cluster will be restored. I will add some handling to
ignore the "CREATE ROLE current_user" command in pg_restore.
<= br>
Thanks Mahendra, Could you please also add some error = message=C2=A0 for this below=C2=A0
pg_restore command:
= postgres=3D# create table t(n int);
CREATE TABLE
postgres=3D# inser= t into t values (1),(10),(100);
INSERT 0 3
Perform=C2=A0pg_dump: ./pg_dump -Ft =C2=A0 -f a.a1= =C2=A0postgres
P= erform=C2=A0pg_restore: /pg_restore =C2=A0-Ft =C2=A0a.a1 -f =C2=A0-C -v
= pg_restore: creating TABLE "public.t"
pg_restore: processing d= ata for table "public.t"
[edb@1a1c15437e7c bin]$ ./psql postgr= es
psql (19devel)
Type "help" for help.
postgres=3D# \d= t
Did not find any tables.
postgres=3D#=C2=A0

regards,

--000000000000bbc9b50645c1663b--