Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
timeline.h45 linesDownload Raw Back to access
1/*2 * timeline.h3 *4 * Functions for reading and writing timeline history files.5 *6 * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group7 * Portions Copyright (c) 1994, Regents of the University of California8 *9 * src/include/access/timeline.h10 */11#ifndef TIMELINE_H12#define TIMELINE_H13 14#include "access/xlogdefs.h"15#include "nodes/pg_list.h"16 17/*18 * A list of these structs describes the timeline history of the server. Each19 * TimeLineHistoryEntry represents a piece of WAL belonging to the history,20 * from newest to oldest. All WAL locations between 'begin' and 'end' belong to21 * the timeline represented by the entry. Together the 'begin' and 'end'22 * pointers of all the entries form a contiguous line from beginning of time23 * to infinity.24 */25typedef struct26{27	TimeLineID	tli;28	XLogRecPtr	begin;			/* inclusive */29	XLogRecPtr	end;			/* exclusive, InvalidXLogRecPtr means infinity */30} TimeLineHistoryEntry;31 32extern List *readTimeLineHistory(TimeLineID targetTLI);33extern bool existsTimeLineHistory(TimeLineID probeTLI);34extern TimeLineID findNewestTimeLine(TimeLineID startTLI);35extern void writeTimeLineHistory(TimeLineID newTLI, TimeLineID parentTLI,36								 XLogRecPtr switchpoint, char *reason);37extern void writeTimeLineHistoryFile(TimeLineID tli, char *content, int size);38extern void restoreTimeLineHistoryFiles(TimeLineID begin, TimeLineID end);39extern bool tliInHistory(TimeLineID tli, List *expectedTLEs);40extern TimeLineID tliOfPointInHistory(XLogRecPtr ptr, List *history);41extern XLogRecPtr tliSwitchPoint(TimeLineID tli, List *history,42								 TimeLineID *nextTLI);43 44#endif							/* TIMELINE_H */45 
codekingpro/portable-devtools · Team Ai