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 1tYIH2-00869a-6O for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Jan 2025 05:18:32 +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 1tYIH0-005ioS-Rm for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Jan 2025 05:18:31 +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 1tYIH0-005ioK-Ie for pgsql-hackers@lists.postgresql.org; Thu, 16 Jan 2025 05:18:31 +0000 Received: from mail-vs1-xe34.google.com ([2607:f8b0:4864:20::e34]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tYIGy-000gJU-38 for pgsql-hackers@postgresql.org; Thu, 16 Jan 2025 05:18:30 +0000 Received: by mail-vs1-xe34.google.com with SMTP id ada2fe7eead31-4aff04f17c7so952079137.0 for ; Wed, 15 Jan 2025 21:18:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737004707; x=1737609507; 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=3ycKueFv7rWWEDGmIo5TVzfABIQ42+TMG1FYprwjcTw=; b=PJyPuor7rpBGM52Nc/U2Lc3AJ59t1UgaRWpSfP6EOFRm3cTgiH0OyCKxjjOnUTfPjb B5POvNgjge9q2LzOFfiC3m+B6NhnZpLzosidCwNrYWd4AbYwDBz/mLaGPpfgxP7NM7IB ZMK3oHseC9Q4fwL5s0tQoz3qXTguhcTGdVh7w1/yaycYDenUx3I/VfNvFAjAZYqQ9XfI br4uqDO0xrMzv4p7MM+sOEGs1Ea2CbitqotjQWT1P7wG/y+JSl4/GTLAUY6nqqLJT/+Q CzjooYYYuE8xAfU4Zg1cpsra1wiEYPwnRmGV4WjcKtDbH8AwF0B41ASxIhO1PTkQSZK0 pWAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737004707; x=1737609507; 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=3ycKueFv7rWWEDGmIo5TVzfABIQ42+TMG1FYprwjcTw=; b=jehWBzzMHjzhXnHVs9cWu8sHezlrJlSlJgFtwN2Pipx4fP6YZcdD67Ugd5GMSdDZjM C3fnnZRuZTqDyp9GHGv7MVK2ZmyIeqfu4S8hQtUcsroj7Y8pX/uAVY82U2hTggdqtvqs tGsR/05Wq8NUGaYYoD/7kONiGimD/U6Kv3mhw24jCSuokucAEISpKCNGPQwjIctIlOsu tVvBFm79RtUJVg2Khc7sQjxM5rHFnBL+WnRph0al31d3c0fx/hiISfJtpu7Guno/8UhV 1dkzZuv8oW+SY34n0WD6cK+D8DBiOriaObAPHhCI7FNUEl4PJ1zvd8Xfj86CHKQVksft ynGw== X-Forwarded-Encrypted: i=1; AJvYcCXC2u9Jx8O/58xzE90MhP7gddvpPN2+Ab2LRtqAojPmv//pn74/N16XMdnINWorvSJMha1eokgCnJBwOuqK@postgresql.org X-Gm-Message-State: AOJu0YxxkLmatKuACxbYXY8MF3rOfW4xBEULKR7ZFHFL/9csNVzndjf9 4fs3kz0LGkAx/oCnC6QYhVSJmE4/EZB64QLw72t5ip4q87YDkFdpTHdvQZCRiUv91aXxvLdCE8z 3tGz7nw0UikQp8JyjT2NJT/83fsdj1Ilg X-Gm-Gg: ASbGncsLqFH70oTVU+PgJ3AoyVNhAa3inh1ZKzb1WwBoWqSW84rIZI9b/WKuyA01VX4 BsHnzHNmwnt7VR3MijZwyVV7mmXcZQTVxaqtG8yHIaeKKe/Qfl5mtDakjdlDyZ2MhEnYdVw== X-Google-Smtp-Source: AGHT+IHEA/cYbK7rBG5fZhXnp7dxCHXiOkXAYu4iyIjzuEw+O8V+3cOIQ6xzyidkQO82Y64dSC3c/JASejCVoC2DFs0= X-Received: by 2002:a05:6102:3e88:b0:4b5:aa91:f29f with SMTP id ada2fe7eead31-4b669f7b2e8mr4595443137.8.1737004707585; Wed, 15 Jan 2025 21:18:27 -0800 (PST) MIME-Version: 1.0 References: <202501110844.5ztsym4vbflm@alvherre.pgsql> In-Reply-To: From: jian he Date: Thu, 16 Jan 2025 13:17:51 +0800 X-Gm-Features: AbW1kvaObX25xJfpvKijLapLEAQgoprNVPammXm78Bwq8LthyG-uFclLzsZK2sM Message-ID: Subject: Re: Non-text mode for pg_dumpall To: Mahendra Singh Thalor Cc: Alvaro Herrera , Guillaume Lelarge , Nathan Bossart , Magnus Hagander , Tom Lane , Andrew Dunstan , PostgreSQL-development , Dilip Kumar Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk hi. in master src/bin/pg_dump/pg_restore.c: main function if (opts->tocSummary) PrintTOCSummary(AH); else { ProcessArchiveRestoreOptions(AH); RestoreArchive(AH); } opts->tocSummary is true (pg_restore --list), no query will be executed. but your patch (pg_restore --list) may call execute_global_sql_commands, which executes a query. sscanf(line, "%u" , &db_oid); sscanf(line, "%s" , db_oid_str); i think it would be better sscanf(line, "%u %s" , &db_oid, db_oid_str); in doc/src/sgml/ref/pg_dumpall.sgml Note: This option can be omitted only when --format=p|plain. maybe change to Note: This option can be omitted only when is plain. --format=format section: "" Under this databases subdirectory, there will be subdirectory with dboid name for each database. "" this sentence is not correct? because drwxr-xr-x databases .rw-rw-r-- global.dat .rw-rw-r-- map.dat "databases" is a directory, and under the "database" directory, it's a list of files. each file filename is corresponding to a unique database name so there is no subdirectory under subdirectory? in src/bin/pg_dump/meson.build you need add 'common_dumpall_restore.c', to the pg_dump_common_sources section. otherwise meson build cannot compile. $BIN6/pg_restore --dbname=src6 --verbose --list $SRC6/dumpall.custom6 pg_restore: error: option -C/--create should be specified when using dump of pg_dumpall this command should not fail? in doc/src/sgml/ref/pg_restore.sgml ... also need plain ?