Re: Non-text mode for pg_dumpall - Mailing list pgsql-hackers

From jian he
Subject Re: Non-text mode for pg_dumpall
Date
Msg-id CACJufxFJ9yJ=+WAHpXbDxf077Xw3O+ZziTwS55+ZK5APJ+6mUg@mail.gmail.com
Whole thread Raw
In response to Re: Non-text mode for pg_dumpall  (jian he <jian.universality@gmail.com>)
Responses Re: Non-text mode for pg_dumpall
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Corey Huinker
Date:
Subject: Re: Statistics Import and Export
Next
From: Sumanth Vishwaraj
Date:
Subject: Re: [External] : Re: New feature request for adding session information to PostgreSQL transaction log