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 1vU5sa-00GrOX-2W for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Dec 2025 16:20:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vU5sZ-008iXm-2a for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Dec 2025 16:20:28 +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 1vU5pV-008g2F-0i for pgsql-hackers@lists.postgresql.org; Fri, 12 Dec 2025 16:17:18 +0000 Received: from mail-qt1-x830.google.com ([2607:f8b0:4864:20::830]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vU5pT-000NRs-1f for pgsql-hackers@lists.postgresql.org; Fri, 12 Dec 2025 16:17:17 +0000 Received: by mail-qt1-x830.google.com with SMTP id d75a77b69052e-4edb6e678ddso17244071cf.2 for ; Fri, 12 Dec 2025 08:17:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765556234; x=1766161034; 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=es76O00UlZToVa7bCpf7ykDQUlB9j5hbgeX/2fPvDpg=; b=AlOdtsNA8xZ7DwhJsl9Eictzbs9yp9L/Du8NpYIsJlktJXH4Ymed1pWrPqz1v85w6e gKzC9u0Ku0eNVBqijoiXcyuN8Is35oQq90Jge96TQTfablbJsKhdZyu+e9yjF4QvZG3S JU0lh2YasUslrIjshNTOXcuC2eMj62nySBZBPi2A5n8UxbIuzw8t8cwTMwbCFP3crNb/ ziw1ypnSFbpTCx2J7bc8icbEriJj6Tlo4N3WV3Q1VQex3hOzqeMLcFCZRtNAOBW1e18e LUcg+ogjMSZ3CxXzLO7fA0IucWr3tG8EWNzxQc7c1r2mLmR6jZ1QaxEdbN21Fb2jVV+z fGcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765556234; x=1766161034; 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=es76O00UlZToVa7bCpf7ykDQUlB9j5hbgeX/2fPvDpg=; b=jevQH3ktnrungfctfZjEIFHfs7lpaOPNh8UCIQmWlt6FZxJfRAvE5zxaHJ0dPFMLw1 xf44rhqL41Qz8p+i/aMtBtXlRVmhAtMZjY82a4o6vI7qHBaOS6mXkmTpBHsphGWtc4vO 3zGmLhE85ZDVWN9h/ibwJIX+3mUyssqzbmRrkgrIQyN/cQiOUa64b1BKpPnqZNve+u5q s61GqvuuHDTxjD+p9boTTLoPLK36FORS3FzvOEDdy/eD4IdS+kOW7K9wPxOPrWYbSp3L RfHynWC3JXyEQwn/iHZ97YP7sAAJXfrPoRF/Ac6IlpRE7bZlbjI/60XGW6FYBJBzMHRJ foSQ== X-Forwarded-Encrypted: i=1; AJvYcCV+rSZ4QfJGl2RXmrMlo7z4/iyponpDugVSM2eYwYDW2qg/ruTlwTkddbvlG48zNhk0MFHxxrvRa/XdhylR@lists.postgresql.org X-Gm-Message-State: AOJu0Yx+cSDUvkKISsDZY3cCFs9NZrqPrAba0Rcm95YDq6Aczccm78BT ZbKPhRcdxkzeg6HgR909Gh5BNoAdLTHnNBfMqNDKGb7hOTP21km+9NY44bBCi9bU5r6K+3PeUQJ PExdk+iesPkx6TuZOSUmqU8KEV7DXqss= X-Gm-Gg: AY/fxX6BvVGtKNkA5kAdmXb217PunTF+OWmOIivxP0s9flkyWdqN2j7Us6Qty2beGF0 FW8aQA9CbmVFbjHhRsp/7n7jM0zACLtF77yTe9g24H3OTYVTPvOZi9H+z+xRMNvOa9H+Q1QD2+/ G1PQZCL86Y1Atzjjg+b+zhp+rRbvPK00B2QEagAf2juL00O7dqpR3eGZTrLrtSRdqB+cLPGy3t9 VeNhHB/Axt9jF7i+UJ2ED74OXqBQdliiVhOluRbDkMvQBZM3wc83dzSuVxB5/iOr/YSl49s X-Google-Smtp-Source: AGHT+IHsyTlfqYM9nzrIhREUDrnG7ZobeNnk0eK07NVjqsTWmBPxrAubtta2s9+BGoyVU2ZglJzTrSA2Af5OlhVrTBQ= X-Received: by 2002:a05:622a:392:b0:4ed:6ab0:bd26 with SMTP id d75a77b69052e-4f1d05a926dmr37102541cf.46.1765556232489; Fri, 12 Dec 2025 08:17:12 -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: Mahendra Singh Thalor Date: Fri, 12 Dec 2025 21:47:00 +0530 X-Gm-Features: AQt7F2oRR1UsqJjTkG7SNJpuZzGsaCgIo9hUXmbA3RNnumTiEmAy0Pj3J9_9khQ Message-ID: Subject: Re: Non-text mode for pg_dumpall To: tushar Cc: 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, 12 Dec 2025 at 19:10, tushar wrote: > > > > 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 b= elow > 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, > Hi Tushar, This is the handling of command line arguments. In code, after "-f", we expect file name, but here you are using "-C" which will be considered as file name. This is the case for all the command line arguments. If pg_restore has the "-f" option, then the "-d database" name can't be given and data will be copied into "-f filename" (it will not be restored in the cluster). Please let me know if you still have some doubts. --=20 Thanks and Regards Mahendra Singh Thalor EnterpriseDB: http://www.enterprisedb.com