1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-03 15:22:11 +03:00

Split out recovery confing-writing code from pg_basebackup

... into a new file, fe_utils/recovery_gen.c.

This can later be used by pg_rewind.

Authors: Paul Guo, Jimmy Yih, Ashwin Agrawal.  A few tweaks by Álvaro Herrera
Reviewed-by: Michaël Paquier
Discussion: https://postgr.es/m/CAEET0ZEffUkXc48pg2iqARQgGRYDiiVxDu+yYek_bTwJF+q=Uw@mail.gmail.com
This commit is contained in:
Alvaro Herrera
2019-09-25 14:35:24 -03:00
parent f5daf7f326
commit caba97a9d9
5 changed files with 211 additions and 161 deletions

View File

@@ -0,0 +1,28 @@
/*-------------------------------------------------------------------------
*
* Generator for recovery configuration
*
* Portions Copyright (c) 2011-2019, PostgreSQL Global Development Group
*
* src/include/fe_utils/recovery_gen.h
*
*-------------------------------------------------------------------------
*/
#ifndef RECOVERY_GEN_H
#define RECOVERY_GEN_H
#include "libpq-fe.h"
#include "pqexpbuffer.h"
/*
* recovery configuration is part of postgresql.conf in version 12 and up, and
* in recovery.conf before that.
*/
#define MINIMUM_VERSION_FOR_RECOVERY_GUC 120000
extern PQExpBuffer GenerateRecoveryConfig(PGconn *pgconn,
char *pg_replication_slot);
extern void WriteRecoveryConfig(PGconn *pgconn, char *target_dir,
PQExpBuffer contents);
#endif /* RECOVERY_GEN_H */