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.94.2) (envelope-from ) id 1tWe2I-000ZR7-Ip for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Jan 2025 16:08:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tWe2G-00ARd7-Is for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Jan 2025 16:08: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.94.2) (envelope-from ) id 1tWe2G-00ARcz-88 for pgsql-hackers@lists.postgresql.org; Sat, 11 Jan 2025 16:08:27 +0000 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tWe2C-0015vk-22 for pgsql-hackers@postgresql.org; Sat, 11 Jan 2025 16:08:27 +0000 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-38634c35129so2194043f8f.3 for ; Sat, 11 Jan 2025 08:08:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736611703; x=1737216503; darn=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=lqIYzoZbff/ahB4v/2/h4P/u3Kitldk+iWMopsM25XE=; b=eEWEOjBYBOjiOuvcScoNUK27gaEOI7iB/jzRW8hhYfR0g2yfVNx1jwK1Dg2U04RRbJ g1lydi1KFHe3PRcdamqqQUgzrnkFj8tGM6emyqR+BEFK9W6l7OdY+k+qacLfMFj4StOD X0R83oQen8GnFLxa0ynwjH8WWIigd5sGsPKXQmFwkHWyfWSBVDM6aXcgyqNIQfE8Mlno GcGIGg6cQW1ZtNhjN8BklJS3ip4SqvjV/dC6o/hpdKlzl+lZxoXd2MK1KyeZxbVttN9a Gz8saAoME3G5hmQWlKJVWANajPAkQ/pFXXihpcKAMSoWjCtgWOYVJkPzVySUMRrJxTPc T2Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736611703; x=1737216503; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lqIYzoZbff/ahB4v/2/h4P/u3Kitldk+iWMopsM25XE=; b=Dwraxzg742MHxOI+jC6hfcpI4tuj1e9swyxs/qhWwWf0VYYZ5whueFADIqEFmi8AhB Z5/sw05vixmQFcq3tVVFyZ8aQcXQnXlKYdEtVoo1OlOcPL+aM907Jr+dbySOqgVCfdAB LHn6DrC2WNkILlvC3Z7syzqilphwfiwtBaLwTlmeFoLrplWrHJPUVoNWsvNZjyf3VEBm vjskOedqC5cDj8q98hSNFOQgq5UvVLKw56kxa7xyS3SO8V9s84bLOEzs6TcqyeamlX3P kOWrpsyd2orbgBqXLq6i3EB3S0vwcmJG874iKi6Tqq0irGKClK+5tbQITNeK316qe6eC 7qSg== X-Forwarded-Encrypted: i=1; AJvYcCUeBW/IFTvHmR1Lalgea0aKRTwwndqnGocvV9w2xmICKLPl8LWZZrcfVUN0jQ4FFy5tRVxVvPcxvSxRfdIF@postgresql.org X-Gm-Message-State: AOJu0YycUBL8DUwypCnoW/luEC/8DMqTqr8iLgcKdwjenZfjyHsLjE34 bH/F3hC847CBg4V8ScbZUGtT8CHsZB4s/yE9hLe51PgdUlmDZo8D7V/eTa/kqSUGYw70DIGE75C GrFPLQCbXbbhU8p/7ALmOZjQspIk= X-Gm-Gg: ASbGncuCMZxx+DL9bl2cCJJNbOEX+P1gBeQxrbkcSoJCzqwVffrSX38252ZyDJB4LEQ Sz98G+R3mKgOa81teqf/5oCbI8R+S1w9vibPlFaD/B71Fr4HpSiBRWsCUiYZEEetw7MOkVTZ1 X-Google-Smtp-Source: AGHT+IHjhHRXYo1My7lKRwV4rWUQ2wHnOga/1mU2da0N8yYIH05wDiQzLL6r5Cgf4eWbdMRx3jjDrYGgwmckxcKZljg= X-Received: by 2002:a5d:47c3:0:b0:385:de8d:c0f5 with SMTP id ffacd0b85a97d-38a87305374mr13282738f8f.16.1736611703045; Sat, 11 Jan 2025 08:08:23 -0800 (PST) MIME-Version: 1.0 References: <202501110844.5ztsym4vbflm@alvherre.pgsql> In-Reply-To: From: Mahendra Singh Thalor Date: Sat, 11 Jan 2025 21:38:12 +0530 X-Gm-Features: AbW1kvbDfxOQPca4Vrd0PbqEO3IqBkMPtLWL5ojnrJSO3pgSIbUFJQt81xXKVPU Message-ID: Subject: Re: Non-text mode for pg_dumpall To: jian he Cc: Alvaro Herrera , Guillaume Lelarge , Nathan Bossart , Magnus Hagander , Tom Lane , Andrew Dunstan , PostgreSQL-development , Dilip Kumar Content-Type: multipart/alternative; boundary="000000000000ac472b062b706bf6" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000ac472b062b706bf6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, 11 Jan 2025 at 9:30=E2=80=AFPM, jian he wrote: > hi. > the following two tests, you can add to src/bin/pg_dump/t/001_basic.pl > > command_fails_like( > [ 'pg_restore', '--globals-only', '-f', 'xxx' ], > qr/\Qpg_restore: error: option -g\/--globals-only requires option > -d\/--dbname\E/, > 'pg_restore: error: option -g/--globals-only requires option > -d/--dbname' > ); > command_fails_like( > [ 'pg_restore', '--globals-only', '--file=3Dxxx', > '--exclude-database=3Dx',], > qr/\Qpg_restore: error: option --exclude-database cannot be used > together with -g\/--globals-only\E/, > 'pg_restore: error: option --exclude-database cannot be used > together with -g/--globals-only' > ); > > > in pg_restore.sgml. > > > > the position should right after > > > > > > should > pg_restore --globals-only > pg_restore --exclude-database=3Dpattern > be in a separate patch? > > > i am also wondering what will happen: > pg_restore --exclude-database=3Dpattern --dbname=3Dpattern For restore, we will make server connection with =E2=80=98pattern=E2=80=99 = database and we will skip restoring for =E2=80=98pattern=E2=80=99 database as we are giving= =E2=80=98pattern=E2=80=99 with =E2=80=94exclude-database. With server connection, we will restore global.dat at the start of pg_restore. Thanks and regards Mahendra Singh Thalor EDB postgres > --000000000000ac472b062b706bf6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Sat, 11 Jan 2025 at 9:30=E2=80=AFPM, jia= n he <jian.universality@g= mail.com> wrote:
hi.
the following two tests, you can add to src/bin/pg_dump/t/001_basic.pl

command_fails_like(
=C2=A0 =C2=A0 [ 'pg_restore', '--globals-only', '-f'= ;, 'xxx' ],
=C2=A0 =C2=A0 qr/\Qpg_restore: error: option -g\/--globals-only requires op= tion
-d\/--dbname\E/,
=C2=A0 =C2=A0 'pg_restore: error: option -g/--globals-only requires opt= ion -d/--dbname'
);
command_fails_like(
=C2=A0 =C2=A0 [ 'pg_restore', '--globals-only', '--file= =3Dxxx', '--exclude-database=3Dx',],
=C2=A0 =C2=A0 qr/\Qpg_restore: error: option --exclude-database cannot be u= sed
together with -g\/--globals-only\E/,
=C2=A0 =C2=A0 'pg_restore: error: option --exclude-database cannot be u= sed
together with -g/--globals-only'
);


in pg_restore.sgml.
=C2=A0 =C2=A0 =C2=A0<varlistentry>
=C2=A0 =C2=A0 =C2=A0 <term><option>--exclude-database=3D<rep= laceable
class=3D"parameter">pattern</replaceable></option>= </term>
=C2=A0 =C2=A0 =C2=A0 <listitem>
the position should right after
=C2=A0 =C2=A0 =C2=A0<varlistentry>
=C2=A0 =C2=A0 =C2=A0 <term><option>-d <replaceable
class=3D"parameter">dbname</replaceable></option>&= lt;/term>
=C2=A0 =C2=A0 =C2=A0 <term><option>--dbname=3D<replaceable class=3D"parameter">dbname</replaceable></option>&= lt;/term>


should
pg_restore --globals-only
pg_restore --exclude-database=3Dpattern
be in a separate patch?


i am also wondering what will happen:
pg_restore --exclude-database=3Dpattern --dbname=3Dpattern

For restore, we will make server = connection with =E2=80=98pattern=E2=80=99 database and we will skip restori= ng for =E2=80=98pattern=E2=80=99 database as we are giving =E2=80=98pattern= =E2=80=99 with =E2=80=94exclude-database.
With serve= r connection, we will restore global.dat at the start of pg_restore.
<= div dir=3D"auto">
Thanks and regards=C2=A0
=
Mahendra Singh Thalor
=C2=A0EDB po= stgres


--000000000000ac472b062b706bf6--