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 1tf8JV-00HXHP-Vm for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Feb 2025 02:05:22 +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 1tf8JR-000Q8Q-Lc for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Feb 2025 02:05:17 +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 1tf8JR-000Q8I-9F for pgsql-hackers@lists.postgresql.org; Tue, 04 Feb 2025 02:05:17 +0000 Received: from mail-ua1-x935.google.com ([2607:f8b0:4864:20::935]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tf8JO-0038dT-1R for pgsql-hackers@lists.postgresql.org; Tue, 04 Feb 2025 02:05:16 +0000 Received: by mail-ua1-x935.google.com with SMTP id a1e0cc1a2514c-85c61388e68so1014275241.3 for ; Mon, 03 Feb 2025 18:05:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738634713; x=1739239513; 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=wTRnmBuSq+5xkrTEd96Ihc+9Vao6x9Usuj89b1egUoo=; b=ntoBv08APv+do3mEjkYqYirQSpvEFo2DxouNLDk8KoLxYjSK28qLWERXsgihRc4jZU ZfQ0u3d9dWIHYyMZiAvCmagWPbv4t0Dea4TpqyLry6B9zcU6koOyr17VqLHyYpWRXwhp 9GEgIrXHYRKmBULevo085mRURAC7TrxfuqgSdy9No23TPGZNmLVK1a6IQKEDGPVXeNlH 9j+yU81/QQkBlX8qv4kMCWDY21Cqcb4Bs0LlEnmErb9ia+f614xuQC9XY93z/JwQ9iOl AyPD36f+ooYwgooCtyxtU+N/ttxGu6ZrPYyygCd/+C/AUGkPtBkNFscFzK31NCMV27Q6 Nawg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738634713; x=1739239513; 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=wTRnmBuSq+5xkrTEd96Ihc+9Vao6x9Usuj89b1egUoo=; b=Gh0gdwlfpECwYGk9sxOQP15nVXIR99xOC4VZuGXBe1zC9E77jFF+CZS1sd4liYeCdo 7X9DNqIU+MyGMm7D0ol9YmBpXODstobtif2dcxv5wAkwgnn71Wvvjmu+lvbsfNlwJwVg kOwyWx2k93AFj/T+PMHvA6HplRk/qU3n89bJKpUHBautHkYWc8SZndIuTba2d7c+RciH qZulm+UEGj8kp4RwPWdRc5icBW55rRRA4EIxM8MPnkdrgyRNN05SHOTgflXhuDrdAdIV OcE5unCTL9toCNicKyPdO7B0RfzfSv5SODH/LeM7MCnlvBWC06PpI52oWuBPqASmfheM VCHw== X-Forwarded-Encrypted: i=1; AJvYcCVHjWFpPVFVLbpXjpQZ8CJFR/FOeTyCs91jHoBygxtC0A2bqZJVmls+NIBu5/X7flH2bnKUJa9nuWzykww1@lists.postgresql.org X-Gm-Message-State: AOJu0YyTbvDpIXBASjvv0Z6n05xT3MqEiNVTPf5U3tifzMb2kDtPK+oq qZ708mc+P8VwqUbwRmhxPMfpznFKQ3AARBIuTgUpxcYmhGR/fl+g/wM4OxjNRfGAM3jT7B4OWu4 sII6OFkDXwkmySoyz5DTj8oYZ8kY= X-Gm-Gg: ASbGncvWi1TzR31Vu1vExYSzAEhtG6lBuVP9W/JXiv/76MTejDgI4Xt6PYs731TCOzf ABrTYH0LMExM7wWe533Lh6zD/owGoffQV0WoPlCGcd/3SGGpuiQN0h0QQIZKAhVxaicfRDRmu X-Google-Smtp-Source: AGHT+IHXswqpZfepZbEBT3Py334JIbenLP19P/TpWleFEchC5ugBeWmLNTQvZIia3blb//be7fyFNT8ezzBydLROlXc= X-Received: by 2002:a05:6122:2a0b:b0:4f5:199b:2a61 with SMTP id 71dfb90a1353d-51e9e51939dmr18958120e0c.9.1738634712792; Mon, 03 Feb 2025 18:05:12 -0800 (PST) MIME-Version: 1.0 References: <202501110844.5ztsym4vbflm@alvherre.pgsql> In-Reply-To: From: jian he Date: Tue, 4 Feb 2025 10:04:36 +0800 X-Gm-Features: AWEUYZlQutvKMySg58y_IZjadcV-2_Nz0ArPXwaDU99Sp4-wcsWOfu1aKIwq6wU 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. just a quick response for v15. the pg_restore man page says option --list as "List the table of contents of the archive". but $BIN10/pg_restore --format=directory --list --file=1.sql dir10 also output the contents of "global.dat", we should not output it. in restoreAllDatabases, we can do the following change: ``` /* Open global.dat file and execute/append all the global sql commands. */ if (!opts->tocSummary) process_global_sql_commands(conn, dumpdirpath, opts->filename); ``` what should happen with $BIN10/pg_restore --format=directory --globals-only --verbose dir10 --list Should we error out saying "--globals-only" and "--list" are conflict options? if so then in main function we can do the following change: ``` if (globals_only) { process_global_sql_commands(conn, inputFileSpec, opts->filename); if (conn) PQfinish(conn); pg_log_info("databases restoring is skipped as -g/--globals-only option is specified"); } ``` in restoreAllDatabases, if num_db_restore == 0, we will still call process_global_sql_commands. I am not sure this is what we expected.