1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-12-03 09:59:53 +02:00

do not throw an error if database is not found while performing ptrack backup

This commit is contained in:
Anastasia 2017-09-01 13:04:30 +03:00
parent a42add54a1
commit a5e8a54d82

View File

@ -826,8 +826,13 @@ pg_ptrack_get_and_clear(Oid tablespace_oid, Oid db_oid, Oid rel_oid,
res_db = pgut_execute(backup_conn,
"SELECT datname FROM pg_database WHERE oid=$1",
1, (const char **) params);
/*
* If database is not found, it's not an error.
* It could have been deleted since previous backup.
*/
if (PQntuples(res_db) != 1 || PQnfields(res_db) != 1)
elog(ERROR, "cannot find database by oid %u", db_oid);
return NULL;
dbname = pstrdup(PQgetvalue(res_db, 0, 0));
PQclear(res_db);
@ -1877,7 +1882,8 @@ make_pagemap_from_ptrack(parray *files)
/* get ptrack map for all segments of the relation in a raw format */
ptrack_nonparsed = pg_ptrack_get_and_clear(tablespace_oid, db_oid,
rel_oid, &ptrack_nonparsed_size);
if (ptrack_nonparsed != NULL)
{
/*
* FIXME When do we cut VARHDR from ptrack_nonparsed?
* Compute the beginning of the ptrack map related to this segment
@ -1895,6 +1901,7 @@ make_pagemap_from_ptrack(parray *files)
pg_free(ptrack_nonparsed);
}
}
}
}