mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
Check data directory not used by an active instance before cloning
This involves adding some infrastructure to parse pg_control in a reasonably version-independent fashion. This will probably be useful in other contexts where we need to verify the status of a data directory where the instance isn't running.
This commit is contained in:
27
controldata.h
Normal file
27
controldata.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* controldata.h
|
||||
* Copyright (c) 2ndQuadrant, 2010-2017
|
||||
*
|
||||
* Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*/
|
||||
|
||||
#ifndef _CONTROLDATA_H_
|
||||
#define _CONTROLDATA_H_
|
||||
|
||||
#include "postgres_fe.h"
|
||||
#include "catalog/pg_control.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool control_file_processed;
|
||||
ControlFileData *control_file;
|
||||
} ControlFileInfo;
|
||||
|
||||
extern DBState
|
||||
get_db_state(char *data_directory);
|
||||
|
||||
extern const char *
|
||||
describe_db_state(DBState state);
|
||||
|
||||
#endif /* _CONTROLDATA_H_ */
|
||||
Reference in New Issue
Block a user