Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
2eeb5eb2
Commit
2eeb5eb2
authored
Jul 05, 2012
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix PGDATAOLD and PGDATANEW to properly set pgconfig location, per
report from Tom. Backpatch to 9.2.
parent
85254199
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
contrib/pg_upgrade/option.c
contrib/pg_upgrade/option.c
+14
-9
No files found.
contrib/pg_upgrade/option.c
View file @
2eeb5eb2
...
...
@@ -21,7 +21,7 @@
static
void
usage
(
void
);
static
void
check_required_directory
(
char
**
dirpath
,
static
void
check_required_directory
(
char
**
dirpath
,
char
**
configpath
,
char
*
envVarName
,
char
*
cmdLineOption
,
char
*
description
);
...
...
@@ -203,14 +203,14 @@ parseCommandLine(int argc, char *argv[])
}
/* Get values from env if not already set */
check_required_directory
(
&
old_cluster
.
bindir
,
"PGBINOLD"
,
"-b"
,
check_required_directory
(
&
old_cluster
.
bindir
,
NULL
,
"PGBINOLD"
,
"-b"
,
"old cluster binaries reside"
);
check_required_directory
(
&
new_cluster
.
bindir
,
"PGBINNEW"
,
"-B"
,
check_required_directory
(
&
new_cluster
.
bindir
,
NULL
,
"PGBINNEW"
,
"-B"
,
"new cluster binaries reside"
);
check_required_directory
(
&
old_cluster
.
pgdata
,
"PGDATAOLD"
,
"-d"
,
"old cluster data resides"
);
check_required_directory
(
&
new_cluster
.
pgdata
,
"PGDATANEW"
,
"-D"
,
"new cluster data resides"
);
check_required_directory
(
&
old_cluster
.
pgdata
,
&
old_cluster
.
pgconfig
,
"
PGDATAOLD"
,
"-d"
,
"
old cluster data resides"
);
check_required_directory
(
&
new_cluster
.
pgdata
,
&
new_cluster
.
pgconfig
,
"
PGDATANEW"
,
"-D"
,
"
new cluster data resides"
);
}
...
...
@@ -284,15 +284,20 @@ or\n"), old_cluster.port, new_cluster.port, os_info.user);
* user hasn't provided the required directory name.
*/
static
void
check_required_directory
(
char
**
dirpath
,
char
*
envVarName
,
char
*
cmdLineOption
,
char
*
description
)
check_required_directory
(
char
**
dirpath
,
char
**
configpath
,
char
*
envVarName
,
char
*
cmdLineOption
,
char
*
description
)
{
if
(
*
dirpath
==
NULL
||
strlen
(
*
dirpath
)
==
0
)
{
const
char
*
envVar
;
if
((
envVar
=
getenv
(
envVarName
))
&&
strlen
(
envVar
))
{
*
dirpath
=
pg_strdup
(
envVar
);
if
(
configpath
)
*
configpath
=
pg_strdup
(
envVar
);
}
else
pg_log
(
PG_FATAL
,
"You must identify the directory where the %s.
\n
"
"Please use the %s command-line option or the %s environment variable.
\n
"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment