Re: One DB not backed up by pg_dumpall

From: Jaime Casanova <systemguards(at)gmail(dot)com>
To: Francisco Reyes <lists(at)stringsutils(dot)com>
Cc: Michael Fuhr <mike(at)fuhr(dot)org>, PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: One DB not backed up by pg_dumpall
Date: 2005-12-20 16:08:03
Message-ID: c2d9e70e0512200808u786f58adrb6e1aa5309d24054@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 12/20/05, Francisco Reyes <lists(at)stringsutils(dot)com> 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 ;)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-12-20 16:15:18 Re: out of memory during query execution
Previous Message Karsten Hilbert 2005-12-20 16:02:25 Re: is this a bug or I am blind?