Skip to content

Commit c9f3bd3

Browse files
committed
fix datadir log directory for PG v10+
* bin/postgresql-setup.in: Create '$pgdata/log' for PG 10+, and '$pgdata/pg_log' for PG < 10. * configure.ac: Define PGLOGDIR_BASENAME based on PGVERSION.
1 parent 173faa1 commit c9f3bd3

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

NEWS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22

3+
New in 8.3 version:
4+
5+
* postgresql-setup creates correct 'log_directory' based on PG version
6+
(the default changed from $datadir/pg_log to $datadir/log in v10).
7+
8+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9+
310
New in 8.2 version:
411

512
* %postgresql_tests_* macros now use random port for the test PostgreSQL

bin/postgresql-setup.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ perform_initdb()
164164
"${initdbcmd[@]}" >> "$initdb_log" 2>&1 < /dev/null
165165

166166
# Create directory for postmaster log files
167-
mkdir "$pgdata/pg_log"
168-
$RESTORECON "$pgdata/pg_log"
167+
mkdir "$pgdata/@PGLOGDIR_BASENAME@"
168+
$RESTORECON "$pgdata/@PGLOGDIR_BASENAME@"
169169

170170
# This if-fork is just to not unnecessarily overwrite what upstream
171171
# generates by initdb (upstream implicitly uses PGPORT_DEF).

configure.ac

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Use the MAJ.MIN[~SUFF]. Note that X.X > X.X~SUFF!
2-
AC_INIT([postgresql-setup], [8.2], [[email protected]])
2+
AC_INIT([postgresql-setup], [8.3], [[email protected]])
33
AC_CONFIG_AUX_DIR(auxdir)
44
config_aux_dir=auxdir
55
AC_SUBST([config_aux_dir])
@@ -106,6 +106,11 @@ AX_COMPARE_VERSION([9.4], [le], [$PGVERSION],
106106
[PG_UPGRADE_BIN_USER_OPT="--user"])
107107
_AX_TEXT_TPL_SUBST([PG_UPGRADE_BIN_USER_OPT])
108108

109+
PGLOGDIR_BASENAME=log
110+
AX_COMPARE_VERSION([10], [gt], [$PGVERSION],
111+
[PGLOGDIR_BASENAME=pg_log])
112+
_AX_TEXT_TPL_SUBST([PGLOGDIR_BASENAME])
113+
109114
AC_PATH_PROG([PG_UPGRADE_BIN], [pg_upgrade])
110115

111116
if test -z "$PKGCONFIG_DIR" -a "$pgsetup_cv_os_family" = redhat; then

0 commit comments

Comments
 (0)