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 1ta5Xi-00G3O0-Ar for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Jan 2025 04:07:10 +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 1ta5Xg-00AqPE-Qs for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Jan 2025 04:07:08 +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 1ta5Xg-00AqP6-Ha for pgsql-hackers@lists.postgresql.org; Tue, 21 Jan 2025 04:07:08 +0000 Received: from mail-vk1-xa2a.google.com ([2607:f8b0:4864:20::a2a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ta5Xd-000eQZ-2R for pgsql-hackers@postgresql.org; Tue, 21 Jan 2025 04:07:08 +0000 Received: by mail-vk1-xa2a.google.com with SMTP id 71dfb90a1353d-5188b485988so1551937e0c.3 for ; Mon, 20 Jan 2025 20:07:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737432424; x=1738037224; 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=pzCcstQYFQNhd7bgNg87GjOthcD2NSG0mXD+hea4EB0=; b=If8Bc1UnHeVQfaGQTtaak942KghRK9Shw7yYWv3ZjsaGEO6ThwJgS5BYh7Dqn04H/4 aW7Wrr+6m2UaJXp3JjYWSOnrkOm55V1tHBEq21VCNf922zsmmqU7YXixSB7N9fC3FSKF xFunUsFDfCHxVH5EuFWALNH5CGhEdGaCqvzjWGhhCg4Wmech06BqTaBQA2QDvFy8/xuf fJI/ECclI6xXmb/ETmVinmVlKGcuD6R06biSTA1AsLsmSR7la0uVO2GIxZxRmqUo+SA2 SG5vonx5oCdkv1sRBas2vet48SqVBSB/WLNMFoZ9a+zRtegLbGncy1VdvLtAwZ8PAPaC M7EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737432424; x=1738037224; 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=pzCcstQYFQNhd7bgNg87GjOthcD2NSG0mXD+hea4EB0=; b=bHVV9EKCWuv2mnHylrqaXXcaEPgLivtAnXs9HMEdH6UpD66uXhwYtNy5fe/WOSvO5k 76HwN9BCX46VxZKowTErpEAwOdMY4afTZTgYoyHNkae8pg/MSBg8Cn+L81ihKHsSEEa4 3HtEXjG7az9mDpfh5ZdhM1w7ZxRDNgQ8BPktMz34F53PnalMwJ1kff5bAztjhCj/55jx DPAexCRbTyaogKg9ZlfYMEFf1YmTBo+B0nGxLPCR8KlAG/+f5VsuWyGN7vzbjADz63x1 Y7g3QipDOg9aLtz3GEk2fU82f83+WIPOh/iCL3wECXkJXJw8AucxnlgYOEWgGCobckQP M3lQ== X-Forwarded-Encrypted: i=1; AJvYcCX09TGXCPRM2UxYDGDE0S4/D7PwE7ppLWyCjy7nXzGG7BirwF0fi1EIB2THijLrpy/NP01Zu2D8qGK5Wr2C@postgresql.org X-Gm-Message-State: AOJu0YxxW41mB6XgiFoRB3PMdG1K6thyhIbWlgiMPbh8Uch5c5eGRfZa wmd24NvE/R7gG+ebb8xURmkDHTiKj4PnLBvvTbeUW+tCnbkqnPJOtxpisbfWKPlS0S8GlBIc3K0 q/a6FQH7/aqkmFZ7DZxfn/dJ4evY= X-Gm-Gg: ASbGnctb1b9p3XZh4RMRZuy3KHiIbmU9D5ulpLKAl0U0NUBai0CGHU/Mr1v7GNrZYmk Kk+M/fOsgom5KGNrrIiq0tsauFetwyYuEf+mQyEGBtrQQPv1XjG+zSwF8087cjyTwPWeyx5sfHn rLWh8f X-Google-Smtp-Source: AGHT+IG1U5Go7so5UnvH0dgStj1wUcB1/GxAKc8aa0WFhfTCMxN/oZdXPZXmZhTQ0m/PapQjLHSzC1QTdtXiy6ia/tg= X-Received: by 2002:a05:6122:c9d:b0:50c:9834:57b3 with SMTP id 71dfb90a1353d-51d59e4909bmr9643136e0c.4.1737432424420; Mon, 20 Jan 2025 20:07:04 -0800 (PST) MIME-Version: 1.0 References: <202501110844.5ztsym4vbflm@alvherre.pgsql> In-Reply-To: From: jian he Date: Tue, 21 Jan 2025 12:05:58 +0800 X-Gm-Features: AbW1kvbzs8TpM7VkLTrxtZCdC43pMbLT4AvInM7iGYMo2_K7UnQFUJa2TTrzmjo 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. $BIN10/pg_restore --globals-only --verbose --file=test.sql x.dump it will create a "test.sql" file, but it should create file test.sql (no double quotes). ------<>>>>------ if (archDumpFormat != archNull && (!filename || strcmp(filename, "") == 0)) { pg_log_error("options -F/--format=d|c|t requires option -f/--filename with non-empty string"); ... } here, it should be pg_log_error("options -F/--format=d|c|t requires option -f/--file with non-empty string"); ------<>>>>------ the following pg_dumpall, pg_restore not working. $BIN10/pg_dumpall --format=custom --file=x1.dump --globals-only $BIN10/pg_restore --file=3.sql x1.dump ERROR: pg_restore: error: directory "x1.dump" does not appear to be a valid archive ("toc.dat" does not exist) these two also not working: $BIN10/pg_dumpall --format=custom --file=x1.dump --verbose --globals-only $BIN10/pg_restore --file=3.sql --format=custom x1.dump error message: pg_restore: error: could not read from input file: Is a directory ------<>>>>------ IsFileExistsInDirectory function is the same as _fileExistsInDirectory. Can we make _fileExistsInDirectory extern function? + /* If global.dat and map.dat are exist, then proces them. */ + if (IsFileExistsInDirectory(pg_strdup(inputFileSpec), "global.dat") + && IsFileExistsInDirectory(pg_strdup(inputFileSpec), "map.dat")) + { comment typo, "proces" should "process". here, we don't need pg_strdup? ------<>>>>------ # pg_restore tests +command_fails_like( + [ + 'pg_restore', '-p', $port, '-f', $plainfile, + "--exclude-database=grabadge", + '--globals-only' + ], + qr/\Qg_restore: error: option --exclude-database cannot be used together with -g\/--globals-only\E/, + 'pg_restore: option --exclude-database cannot be used together with -g/--globals-only'); We can put the above test on src/bin/pg_dump/t/001_basic.pl, since validating these conflict options don't need a cluster to be set up. typedef struct SimpleDatabaseOidListCell and typedef struct SimpleDatabaseOidList need also put into src/tools/pgindent/typedefs.list