|
7 | 7 | * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
8 | 8 | * Portions Copyright (c) 1994, Regents of the University of California
|
9 | 9 | *
|
10 |
| - * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.151 2004/07/2220:18:40 tgl Exp $ |
| 10 | + * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.152 2004/07/2221:09:37 tgl Exp $ |
11 | 11 | *
|
12 | 12 | *-------------------------------------------------------------------------
|
13 | 13 | */
|
@@ -4008,6 +4008,18 @@ StartupXLOG(void)
|
4008 | 4008 | /* Now we can determine the list of expected TLIs */
|
4009 | 4009 | expectedTLIs=readTimeLineHistory(recoveryTargetTLI);
|
4010 | 4010 |
|
| 4011 | +/* |
| 4012 | + * If pg_control's timeline is not in expectedTLIs, then we cannot |
| 4013 | + * proceed: the backup is not part of the history of the requested |
| 4014 | + * timeline. |
| 4015 | + */ |
| 4016 | +if (!list_member_int(expectedTLIs, |
| 4017 | + (int)ControlFile->checkPointCopy.ThisTimeLineID)) |
| 4018 | +ereport(FATAL, |
| 4019 | +(errmsg("requested timeline %u is not a child of database system timeline %u", |
| 4020 | +recoveryTargetTLI, |
| 4021 | +ControlFile->checkPointCopy.ThisTimeLineID))); |
| 4022 | + |
4011 | 4023 | /*
|
4012 | 4024 | * Get the last valid checkpoint record. If the latest one according
|
4013 | 4025 | * to pg_control is broken, try the next-to-last one.
|
|