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

Commitc755f60

Browse files
author
Thomas G. Lockhart
committed
Implement WAL log location control using "-X" or PGXLOG.
1 parenteb121ba commitc755f60

File tree

1 file changed

+20
-3
lines changed
  • src/backend/access/transam

1 file changed

+20
-3
lines changed

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

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.98 2002/06/20 20:29:25 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.99 2002/08/04 06:53:10 thomas Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -389,7 +389,7 @@ static ControlFileData *ControlFile = NULL;
389389

390390

391391
/* File path names */
392-
staticcharXLogDir[MAXPGPATH];
392+
staticcharXLogDir[MAXPGPATH]="";
393393
staticcharControlFilePath[MAXPGPATH];
394394

395395
/*
@@ -2065,11 +2065,28 @@ ValidXLOGHeader(XLogPageHeader hdr, int emode, bool checkSUI)
20652065
* I/O and compatibility-check functions, but there seems no need currently.
20662066
*/
20672067

2068+
void
2069+
SetXLogDir(char*path)
2070+
{
2071+
if (path!=NULL)
2072+
{
2073+
if (strlen(path) >=MAXPGPATH)
2074+
elog(FATAL,"XLOG path '%s' is too long"
2075+
"; maximum length is %d characters",path,MAXPGPATH-1);
2076+
strcpy(XLogDir,path);
2077+
}
2078+
else
2079+
{
2080+
snprintf(XLogDir,MAXPGPATH,"%s/pg_xlog",DataDir);
2081+
}
2082+
}
2083+
20682084
void
20692085
XLOGPathInit(void)
20702086
{
20712087
/* Init XLOG file paths */
2072-
snprintf(XLogDir,MAXPGPATH,"%s/pg_xlog",DataDir);
2088+
if (strlen(XLogDir) <=0)
2089+
SetXLogDir(NULL);
20732090
snprintf(ControlFilePath,MAXPGPATH,"%s/global/pg_control",DataDir);
20742091
}
20752092

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp