Re: One DB not backed up by pg_dumpall

Поиск
Список
Период
Сортировка
Искать
От
Jaime Casanova
Тема
Re: One DB not backed up by pg_dumpall
Дата
Msg-id
c2d9e70e0512200808u786f58adrb6e1aa5309d24054@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Re: One DB not backed up by pg_dumpall Francisco Reyes <lists@stringsutils.com>
Re: One DB not backed up by pg_dumpall Jaime Casanova <systemguards@gmail.com>
On 12/20/05, Francisco Reyes  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 ;)
В списке pgsql-general по дате отправления
От: Karsten Hilbert
Дата:
От: Tom Lane
Дата:
FAQ