Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b25d23e

Browse files
author
Neil Conway
committed
Don't allow pg_start_backup() to be invoked if archive_command has not
been defined. Patch from Gavin Sherry, editorializing by Neil Conway.
1 parent 0021ae0 commit b25d23e

File tree

1 file changed

+9
-1
lines changed
  • src/backend/access/transam

1 file changed

+9
-1
lines changed

src/backend/access/transam/xlog.c

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.176 2004/11/05 17:10:56 petere Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.177 2004/11/17 02:22:54 neilc Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -5266,6 +5266,14 @@ pg_start_backup(PG_FUNCTION_ARGS)
52665266
ereport(ERROR,
52675267
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
52685268
(errmsg("must be superuser to run a backup"))));
5269+
5270+
if (!XLogArchivingActive())
5271+
ereport(ERROR,
5272+
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
5273+
(errmsg("WAL archiving is not configured"),
5274+
(errhint("archive_command must be defined before "
5275+
"online backups can be safely made.")))));
5276+
52695277
backupidstr = DatumGetCString(DirectFunctionCall1(textout,
52705278
PointerGetDatum(backupid)));
52715279

0 commit comments

Comments
 (0)