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 1vQ3dQ-0080lu-2Z for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Dec 2025 13:08:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vQ3cQ-002lg0-0l for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Dec 2025 13:07:06 +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 1vQ3cP-002lfs-2r for pgsql-hackers@lists.postgresql.org; Mon, 01 Dec 2025 13:07:06 +0000 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vQ3cM-002Yd9-1v for pgsql-hackers@lists.postgresql.org; Mon, 01 Dec 2025 13:07:04 +0000 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-644f90587e5so6680636a12.0 for ; Mon, 01 Dec 2025 05:07:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1764594420; x=1765199220; 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=eHy7wgm9KeWT/MpIA++U8a38zefhrDs0rEsK72QIni4=; b=juYP5zmg3l2OO9nBk7PE/nfW7hTBXNH4bpGIJ+Ho6e3iwU/6uG8uPLwrV/ctLkmSpa veNmmpGiACyZ3yOiZAZRmo9SHKP8iieYKxpf3e/9Ss2wMZn2MZlgbnmwHIycXDVgeqe9 HgNYE+c/pa/TL6JK23c8Km1tKGL17A63uTpuyC0GFQaGhqoVHiJHnkzSZORxyFCQ5DDT G6UyS9MLJsNHT6wsN2d7jO79Cp9ttL/b52anJwnPoqL76e1aylYzwZFIham7iDXE5Erp zel23mKCpeCP/BYmZLL0PJ0tium+ZMibHlxcrG3HewAO+ivKHeBeeFxnxxYmGPeNUI8M XwiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764594420; x=1765199220; 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=eHy7wgm9KeWT/MpIA++U8a38zefhrDs0rEsK72QIni4=; b=SXB8Q8tai5ZsNDzmVxTdwnYV2CJsjOQpeSQgh7qWKsm8XD/zYHjenigIEnBpqxattv U4K8STVlOhcWCreeYUPfMfUJlGBp3sfgK4lft4qMu90gbylm5r2awzKPBracwMj9RcS9 2MFcMSmwj/RWERMeEUUYmF68XUJAtuTg4MzWK1vh22eQiudtauABIu5fIB7aNED9as6B /jhMnsqPnyVvLFq+FV4ADMXsQcjmvY4iQagmwixzKXmBksqM1XB/ZhTTsGHrcyMBBoRC Uqv7t1/a3wSQ3qtH3tAdiKs5yLb4locA9SfHKHtUXRI4YOa1Wj5b+ZFJAMCIXEPFLH/m 3MGw== X-Forwarded-Encrypted: i=1; AJvYcCXSwsVvj0rv+zYhBUEIfLK4kChB28+n8+po7OiGGzOa1GoPHiNmq4mYUU3EDRgKFePuU07rEJyC+hZFdX4P@lists.postgresql.org X-Gm-Message-State: AOJu0YywUJi/ANA9K7tRkKjlKsvLKS/Nyjy951MPPyD5ebt9AAuRuSUj WWh/qxAckdKqIZXi5sx8fWqWnLP0n3QaN+eeZF00Fkigl6RkRvUZARkRlclv0AASoZS5giXZ1PC Kn300bAL+fq/Xf2393hwpT98acwpSk0wfVcChWJCj X-Gm-Gg: ASbGnctBAosPqMLBqo3VsOM66H2KwqcD4ASK/xZH5ToE2zFf2AufYo6htAzc9ErjxeB 0Wq1D/LbYCp5MKAiqLmptyMkCsz07c1YOdXF7Nf20taDOIo4WFTjN+wbWZyNT7Udkch/it8Bulo yhd0WUXNnfNrndJDGPg9k3YIY5OH77pq2p11sxjgYfSZQ8J9zT7mC3MLozHSK4A8tFGNEYlECML cSa1DwplrhSzlo6hpfth4dDmGlHYtJbTqMRmXQ847bkmqHb4RNPfrI/frg+rBln6OMai/LYRV2A InunmjeN X-Google-Smtp-Source: AGHT+IG0F9KeLbSLf1uG9aS5gWZekEjfD7UQvGKyHFyepYKtHQw3OqExiLtiNNeXeAIWL1T0n2rimXmDENy+xT0fPdE= X-Received: by 2002:a05:6402:24d3:b0:647:5525:5b34 with SMTP id 4fb4d7f45d1cf-64755255fb3mr12624838a12.13.1764594420549; Mon, 01 Dec 2025 05:07:00 -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: Mon, 1 Dec 2025 18:36:48 +0530 X-Gm-Features: AWmQ_bkzIcyKU-cAkzcNRY4_KNvc3tBJesARUb3JxaJFJTiK5niwxamvj4c1AL8 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="0000000000009c16550644e3a7b9" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000009c16550644e3a7b9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Nov 27, 2025 at 2:49=E2=80=AFPM Mahendra Singh Thalor wrote: > > Fixed. Here, I am attaching an updated patch for the review and testing. > Thanks Mahendra, please refer this scenario where restoring the dump(database contain tablespace) throwing an error *Steps to reproduce * initdb (./initdb -D data) , start the server ( ./pg_ctl -D data start) , connect to psql terminal ( ./psql postgres) create a directory ( \! mkdir /tmp/abc) , create a tablespace ( create tablespace a location '/tmp/abc'); ) create a table ( create table t(n int) tablespace a; ) , insert data ( insert into t values ('a'); ) perform pg_dumpall with option -c ( ./pg_dumpall -Fc -f my.d) try to perform pg_restore with option --no-tablespaces ( ./pg_restore --no-tablespaces -Fc my.d -d postgres -C) Getting this error : " pg_restore: error: could not execute query: ERROR: role "edb" already exists Command was: CREATE ROLE edb; ALTER ROLE edb WITH SUPERUSER INHERIT CREATEROLE CREATEDB LOGIN REPLICATION BYPASSRLS; pg_restore: error: could not execute query: ERROR: directory "/tmp/abc/PG_19_202511281" already in use as a tablespace Command was: CREATE TABLESPACE a OWNER edb LOCATION '/tmp/abc'; pg_restore: warning: errors ignored on restore: 2 " regards, Tushar https://www.enterprisedb.com/ --0000000000009c16550644e3a7b9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu, Nov 27,= 2025 at 2:49=E2=80=AFPM Mahendra Singh Thalor <mahi6run@gmail.com> wrote:

Fixed. Here, I am attaching an updated patch for the review and testing.

Thanks Mahendra, please refer this scenar= io where restoring the dump(database contain tablespace) throwing an error= =C2=A0

Steps to reproduce=C2=A0
i= nitdb (./initdb -D data) , start the server ( ./pg_ctl -D data start) , con= nect to psql terminal ( ./psql postgres)
create a directory ( \! = mkdir /tmp/abc) , create a tablespace ( create tablespace a location '/= tmp/abc'); )=C2=A0
create a table ( create table t(n int) tab= lespace a; ) , insert data ( insert into t values ('a');=C2=A0 )=C2= =A0
perform=C2=A0pg_dumpall with option -c=C2=A0 (=C2=A0./pg_dump= all -Fc -f my.d)
try to perform pg_restore with option --no-table= spaces=C2=A0 (=C2=A0./pg_restore --no-tablespaces -Fc my.d =C2=A0-d postgre= s -C)=C2=A0
Getting=C2=A0this error :
"
= pg_restore: error: could not execute query: ERROR: =C2=A0role "edb&quo= t; already exists
Command was: CREATE ROLE edb;
ALTER ROLE edb WITH S= UPERUSER INHERIT CREATEROLE CREATEDB LOGIN REPLICATION BYPASSRLS;

pg= _restore: error: could not execute query: ERROR: =C2=A0directory "/tmp= /abc/PG_19_202511281" already in use as a tablespace
Command was: C= REATE TABLESPACE a OWNER edb LOCATION '/tmp/abc';

pg_restore= : warning: errors ignored on restore: 2
"

regards,
Tushar=C2=A0
--0000000000009c16550644e3a7b9--