On 12/20/05, Francisco Reyes <[EMAIL PROTECTED]> wrote:
> Jaime Casanova writes:
>
> > - you still have the server where these databases exists?
>
> No. I lost 3 databases.
>
> > - what version of pgsql, is this?
>
> It was 8.0.4
> I was upgrading to 8.1.
> I checked the nightly jobs had been running, then ran a manual one and
> proceeded to do the upgrade.
>

mmm... so at least you lost another database we can't check the
problem... too bad :(

> > pg_dumpall ignore all databases with datallowconn = true, maybe it is the 
> > case?
>
> The original database is gone so can't check that.
>
> Do you know if there is a way to find out if pg_dumpall had problems?
> Later today I plan to do a mini test.. run pg_dumpall as a user with rights
> to only some tables and see if the program returns an error or if returns a
> value upon failure... so I can modify my script.
>

i haven't tried but it seems that it exits...

/*
 * Dump contents of databases.
 */
static void
dumpDatabases(PGconn *conn)
{
        PGresult   *res;
        int                     i;

        if (server_version >= 70100)
                res = executeQuery(conn, "SELECT datname FROM pg_database WHERE
datallowconn ORDER BY 1");
        else
                res = executeQuery(conn, "SELECT datname FROM pg_database ORDER 
BY 1");

        for (i = 0; i < PQntuples(res); i++)
        {
                int                     ret;

                char       *dbname = PQgetvalue(res, i, 0);

                if (verbose)
                        fprintf(stderr, _("%s: dumping database \"%s\"...\n"), 
progname, dbname);

                printf("\\connect %s\n\n", fmtId(dbname));
                ret = runPgDump(dbname);
                if (ret != 0)
                {
                        fprintf(stderr, _("%s: pg_dump failed on database 
\"%s\",
exiting\n"), progname, dbname);
                        exit(1);
                                                ^^^^^^^^
                }
        }

        PQclear(res);
}

> It would be helpfull if the docs/man page were updated to indicate any info
> about what pg_dumpall does in case of failures.
>
> I am also planning on writing one or more scripts to check the pg_dumpall
> file. My DBs are small enough that I can run a check on them (ie count how
> many DBs were backed up, compare to how many "\connect" the dump file has).
> Hopefully will make them semi-generic so others can re-use them too.
>


--
regards,
Jaime Casanova
(DBA: DataBase Aniquilator ;)

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

Reply via email to