aboutsummaryrefslogtreecommitdiff
path: root/src/include/access/xlog_internal.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-08-03 20:32:36 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-08-03 20:32:36 +0000
commit58c41712d55fadd35477b2ec3a02d12eca2bfbf2 (patch)
treebaa03f635a11d0859072af6c682dd07416a54a57 /src/include/access/xlog_internal.h
parenta83c45c4c60d5fc3603896f8d149856dbb20c42d (diff)
downloadpostgresql-58c41712d55fadd35477b2ec3a02d12eca2bfbf2.tar.gz
postgresql-58c41712d55fadd35477b2ec3a02d12eca2bfbf2.zip
Add functions pg_start_backup, pg_stop_backup to create backup label
and history files as per recent discussion. While at it, remove pg_terminate_backend, since we have decided we do not have time during this release cycle to address the reliability concerns it creates. Split the 'Miscellaneous Functions' documentation section into 'System Information Functions' and 'System Administration Functions', which hopefully will draw the eyes of those looking for such things.
Diffstat (limited to 'src/include/access/xlog_internal.h')
-rw-r--r--src/include/access/xlog_internal.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/include/access/xlog_internal.h b/src/include/access/xlog_internal.h
index 09877bf64be..89c37b7d66a 100644
--- a/src/include/access/xlog_internal.h
+++ b/src/include/access/xlog_internal.h
@@ -11,12 +11,13 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/xlog_internal.h,v 1.1 2004/07/21 22:31:25 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/access/xlog_internal.h,v 1.2 2004/08/03 20:32:34 tgl Exp $
*/
#ifndef XLOG_INTERNAL_H
#define XLOG_INTERNAL_H
#include "access/xlog.h"
+#include "fmgr.h"
#include "storage/block.h"
#include "storage/relfilenode.h"
@@ -177,7 +178,7 @@ typedef XLogLongPageHeaderData *XLogLongPageHeader;
* These macros encapsulate knowledge about the exact layout of XLog file
* names, timeline history file names, and archive-status file names.
*/
-#define MAXFNAMELEN 32
+#define MAXFNAMELEN 64
#define XLogFileName(fname, tli, log, seg) \
snprintf(fname, MAXFNAMELEN, "%08X%08X%08X", tli, log, seg)
@@ -194,6 +195,12 @@ typedef XLogLongPageHeaderData *XLogLongPageHeader;
#define StatusFilePath(path, xlog, suffix) \
snprintf(path, MAXPGPATH, "%s/archive_status/%s%s", XLogDir, xlog, suffix)
+#define BackupHistoryFileName(fname, tli, log, seg, offset) \
+ snprintf(fname, MAXFNAMELEN, "%08X%08X%08X.%08X.backup", tli, log, seg, offset)
+
+#define BackupHistoryFilePath(path, tli, log, seg, offset) \
+ snprintf(path, MAXPGPATH, "%s/%08X%08X%08X.%08X.backup", XLogDir, tli, log, seg, offset)
+
extern char XLogDir[MAXPGPATH];
/*
@@ -221,4 +228,10 @@ typedef struct RmgrData
extern const RmgrData RmgrTable[];
+/*
+ * These aren't in xlog.h because I'd rather not include fmgr.h there.
+ */
+extern Datum pg_start_backup(PG_FUNCTION_ARGS);
+extern Datum pg_stop_backup(PG_FUNCTION_ARGS);
+
#endif /* XLOG_INTERNAL_H */