You've already forked pg_probackup
mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-07-03 05:36:50 +02:00
do not throw an error if database is not found while performing ptrack backup
This commit is contained in:
11
src/backup.c
11
src/backup.c
@ -826,8 +826,13 @@ pg_ptrack_get_and_clear(Oid tablespace_oid, Oid db_oid, Oid rel_oid,
|
|||||||
res_db = pgut_execute(backup_conn,
|
res_db = pgut_execute(backup_conn,
|
||||||
"SELECT datname FROM pg_database WHERE oid=$1",
|
"SELECT datname FROM pg_database WHERE oid=$1",
|
||||||
1, (const char **) params);
|
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)
|
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));
|
dbname = pstrdup(PQgetvalue(res_db, 0, 0));
|
||||||
PQclear(res_db);
|
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 */
|
/* get ptrack map for all segments of the relation in a raw format */
|
||||||
ptrack_nonparsed = pg_ptrack_get_and_clear(tablespace_oid, db_oid,
|
ptrack_nonparsed = pg_ptrack_get_and_clear(tablespace_oid, db_oid,
|
||||||
rel_oid, &ptrack_nonparsed_size);
|
rel_oid, &ptrack_nonparsed_size);
|
||||||
|
if (ptrack_nonparsed != NULL)
|
||||||
|
{
|
||||||
/*
|
/*
|
||||||
* FIXME When do we cut VARHDR from ptrack_nonparsed?
|
* FIXME When do we cut VARHDR from ptrack_nonparsed?
|
||||||
* Compute the beginning of the ptrack map related to this segment
|
* 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);
|
pg_free(ptrack_nonparsed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user