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 1tkGpU-0026xV-T6 for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Feb 2025 06:11:37 +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 1tkGpR-0075PT-6a for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Feb 2025 06:11:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tkGpQ-0075PL-MU for pgsql-hackers@lists.postgresql.org; Tue, 18 Feb 2025 06:11:32 +0000 Received: from mail-vs1-xe31.google.com ([2607:f8b0:4864:20::e31]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tkGpO-001SeU-36 for pgsql-hackers@lists.postgresql.org; Tue, 18 Feb 2025 06:11:31 +0000 Received: by mail-vs1-xe31.google.com with SMTP id ada2fe7eead31-4be25046fceso1608742137.3 for ; Mon, 17 Feb 2025 22:11:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739859090; x=1740463890; 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=EZd7habdypnJDA35itWigW2u47PuTPOzwGiQzYA/U4M=; b=lj5A2/ukwBe9SdXJvRjj/SPmath4glMvg2EYbHepQJ10fbHX2n185JKN2uRY4e9DRI /qvmPn05JSDHGX69Agtn3aPRto9oRx0jpai24da/YcCsOcPMTAh3k0TnHXynTvwf5wkA ANtsRS/7zWsWBqaIc+prkYX3wEAdLuo8akZf+PcOOzEcIws+VtaI6GqfAFMd6ugvkYhp p5aElDYXzWWy95pH4asDr+medkGCDzbcjU0D8eEZZqpeVm6qrxwkd7z2B8ScA5NPqm2Y 6iig4Nv0MNaihpjrX9JQFAxZ7aXTTAxjqDRWhsNHFN+mmzw2eLdeXUvQvMb8HOdkVaec Ay4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739859090; x=1740463890; 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=EZd7habdypnJDA35itWigW2u47PuTPOzwGiQzYA/U4M=; b=t/ButvCVgqRkq6xQj5F3NlLkEgg2rrFRgQHdlDw89TEMFJZUkX0OH8LqOawOovDlQh 00QVoAUHiVEPUXajm+zYHO3pQ9YUgw67ccMhQko5SJ/cRpQEkGn62y9lEwLevtJdd7wa FsfQBe9LkLpHzqLRIOHol4UsdT0oiXKLVgh8FYCe+HOYYDtP3FES+aa5x/k+JrgIKqR/ gACSkB3uk2SekPbmKjd5rUDZxy3RWzmL+tt9jdAhVsCS+CBBV0qPGxORe78BRie38nQ3 193j34WsXSfaLbt7Y05AmoTXfek8f8KflEEEukL4IxNxBuLIowStY8oRWcBeIA6cotQu VIZw== X-Forwarded-Encrypted: i=1; AJvYcCXkAuZjn1M8c7tW+AnmbzRshbZXit09DlnnxCjQbBrozeV/TKTxcwex0MsZt3EYCr5P7Pb7+M4GvXZUP8E6@lists.postgresql.org X-Gm-Message-State: AOJu0Yx+nsRlXEba1MNRwclIssJp4FghGxzjAMutc8IlrIAYeP/JoogJ KxYncCcht0D1JnNFgW+BoLerPmCdOfabHIckdVVaGJ0NK1/Syurq6Edne1RDxTBLWAbVzpOkf5f mmhOByj0oDwaRgkLGnzWJZEsU8nw= X-Gm-Gg: ASbGncv3TVTHuL6N1wiVb38BkzBnvzhQdv+9nErMdm9uTBoet20qxo2kb8WLXiBhwmW T4anHk5/ylMqfh7Pv1mllKKKL1IvtYUADt5hYfcJikcrlirWO2tO1vDtNcNx39fodfl9w741IsF /zgx4J0JB2uUCOrxEwvWWvxYnLBOdm X-Google-Smtp-Source: AGHT+IEhC/euZlncs4RRh8m4Qcq03hL+gitK9hchj5LZuW+XFk6lasP0rs7hXYZEKW9GIRPxB9gd6JDtavqdrt1LiWQ= X-Received: by 2002:a05:6102:f10:b0:4bb:e36f:6a35 with SMTP id ada2fe7eead31-4bd3fd2ebb8mr5766738137.14.1739859089927; Mon, 17 Feb 2025 22:11:29 -0800 (PST) MIME-Version: 1.0 References: <202501110844.5ztsym4vbflm@alvherre.pgsql> In-Reply-To: From: jian he Date: Tue, 18 Feb 2025 14:10:52 +0800 X-Gm-Features: AWEUYZmB9lyobg2JckAucQsswR-yFBEtH9xSei0YV105Eol40ZWx99guIyzV5Oc Message-ID: Subject: Re: Non-text mode for pg_dumpall To: Mahendra Singh Thalor Cc: Srinath Reddy , pgsql-hackers@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk hi. pg_restore restore a PostgreSQL database from an archive file created by pg_dump or restore multiple PostgreSQL database from an archive directory created by pg_dumpall i think it's way too verbose. we can change it to: restore PostgreSQL database from an archive file created by pg_dump or pg_dumpall pg_restore is a utility for restoring a PostgreSQL database from an archive created by in one of the non-plain-text formats. we can change it to pg_restore is a utility for restoring PostgreSQL databases from an archive created by or in one of the non-plain-text formats. similarly, pg_dumpall first 3 sentences in the description section needs to change. in pg_restore.sgml --create is required. like: "This option is required when restoring multiple databases." restoreAllDatabases + if (!conn) + pg_log_info("there is no database connection so consider pattern as simple name for --exclude-database"); filter_dbnames_for_restore + if (!conn) + pg_log_info("considering PATTERN as NAME for --exclude-database option as no db connection while doing pg_restore."); these two log messages sent out the same information. maybe we can remove the first one, and change the second to if (!conn && db_exclude_patterns.head != NULL) pg_log_info("considering PATTERN as NAME for --exclude-database option as no db connection while doing pg_restore."); as mentioned in the previous thread, there is no need to change PrintTOCSummary. another minor issue about comments. I guess we can tolerate this minor issue. $BIN10/pg_restore --format=tar --create --file=1.sql --exclude-database=src10 --verbose tar10 > dir_format 2>&1 1.sql file will copy tar10/global.dat as is. but we already excluded src10. but 1.sql will still have comments as -- -- Database "src10" dump -- $BIN10/pg_dumpall --format=custom --file=x1.dump --globals-only $BIN10/pg_dumpall --format=custom --file=x2.dump Currently x1.dump/global.dat is differ from x2.dump/global.dat if we dump multiple databases using pg_dumpall we have " -- -- Databases -- -- -- Database "template1" dump -- -- -- Database "src10" dump -- -- -- Database "x" dump -- " maybe there are not need, since we already have map.dat file I am not sure if the following is as expected or not. $BIN10/pg_dumpall --format=custom --file=x1.dump --globals-only $BIN10/pg_restore --create --file=3.sql --globals-only x1.dump --verbose $BIN10/pg_restore --create --file=3.sql x1.dump --verbose the first pg_restore command will copy x1.dump/global.dat as is to 3.sql, the second pg_restore will not copy anything to 3.sql. but the second command implies copying global dumps to 3.sql?