Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit370f770

Browse files
committed
Forbid using pg_xlogfile_name() and pg_xlogfile_name_offset() during
recovery. We might want to relax this in the future, but ThisTimeLineIDisn't currently correct in backends during recovery, so the filenamereturned was wrong.
1 parent9c40543 commit370f770

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

‎doc/src/sgml/func.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.512 2010/04/03 07:53:02 petere Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.513 2010/04/07 06:12:52 heikki Exp $ -->
22

33
<chapter id="functions">
44
<title>Functions and Operators</title>
@@ -13064,8 +13064,8 @@ SELECT set_config('log_statement_stats', 'off', false);
1306413064
<para>
1306513065
The functions shown in <xref
1306613066
linkend="functions-admin-backup-table"> assist in making on-line backups.
13067-
Use of the first threefunctionsis restricted to superusers. The first
13068-
five functions cannot be executed during recovery.
13067+
Thesefunctionscannot be executed during recovery.
13068+
Use of the first three functions is restricted to superusers.
1306913069
</para>
1307013070

1307113071
<table id="functions-admin-backup-table">

‎src/backend/access/transam/xlog.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2010, 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.389 2010/04/06 17:51:58 sriggs Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.390 2010/04/07 06:12:52 heikki Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -8410,6 +8410,12 @@ pg_xlogfile_name_offset(PG_FUNCTION_ARGS)
84108410
HeapTupleresultHeapTuple;
84118411
Datumresult;
84128412

8413+
if (RecoveryInProgress())
8414+
ereport(ERROR,
8415+
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
8416+
errmsg("recovery is in progress"),
8417+
errhint("pg_xlogfile_name_offset() cannot be executed during recovery.")));
8418+
84138419
/*
84148420
* Read input and parse
84158421
*/
@@ -8479,6 +8485,12 @@ pg_xlogfile_name(PG_FUNCTION_ARGS)
84798485
XLogRecPtrlocationpoint;
84808486
charxlogfilename[MAXFNAMELEN];
84818487

8488+
if (RecoveryInProgress())
8489+
ereport(ERROR,
8490+
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
8491+
errmsg("recovery is in progress"),
8492+
errhint("pg_xlogfile_name() cannot be executed during recovery.")));
8493+
84828494
locationstr=text_to_cstring(location);
84838495

84848496
if (sscanf(locationstr,"%X/%X",&uxlogid,&uxrecoff)!=2)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp