Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
2eeb5eb2
Commit
2eeb5eb2
authored
12 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Fix PGDATAOLD and PGDATANEW to properly set pgconfig location, per
report from Tom. Backpatch to 9.2.
parent
85254199
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/pg_upgrade/option.c
+14
-9
14 additions, 9 deletions
contrib/pg_upgrade/option.c
with
14 additions
and
9 deletions
contrib/pg_upgrade/option.c
+
14
−
9
View file @
2eeb5eb2
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
static
void
usage
(
void
);
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
);
char
*
envVarName
,
char
*
cmdLineOption
,
char
*
description
);
...
@@ -203,14 +203,14 @@ parseCommandLine(int argc, char *argv[])
...
@@ -203,14 +203,14 @@ parseCommandLine(int argc, char *argv[])
}
}
/* Get values from env if not already set */
/* 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"
);
"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"
);
"new cluster binaries reside"
);
check_required_directory
(
&
old_cluster
.
pgdata
,
"PGDATAOLD"
,
"-d"
,
check_required_directory
(
&
old_cluster
.
pgdata
,
&
old_cluster
.
pgconfig
,
"old cluster data resides"
);
"PGDATAOLD"
,
"-d"
,
"old cluster data resides"
);
check_required_directory
(
&
new_cluster
.
pgdata
,
"PGDATANEW"
,
"-D"
,
check_required_directory
(
&
new_cluster
.
pgdata
,
&
new_cluster
.
pgconfig
,
"new cluster data resides"
);
"PGDATANEW"
,
"-D"
,
"new cluster data resides"
);
}
}
...
@@ -284,15 +284,20 @@ or\n"), old_cluster.port, new_cluster.port, os_info.user);
...
@@ -284,15 +284,20 @@ or\n"), old_cluster.port, new_cluster.port, os_info.user);
* user hasn't provided the required directory name.
* user hasn't provided the required directory name.
*/
*/
static
void
static
void
check_required_directory
(
char
**
dirpath
,
char
*
envVarName
,
check_required_directory
(
char
**
dirpath
,
char
**
configpath
,
char
*
cmdLineOption
,
char
*
description
)
char
*
envVarName
,
char
*
cmdLineOption
,
char
*
description
)
{
{
if
(
*
dirpath
==
NULL
||
strlen
(
*
dirpath
)
==
0
)
if
(
*
dirpath
==
NULL
||
strlen
(
*
dirpath
)
==
0
)
{
{
const
char
*
envVar
;
const
char
*
envVar
;
if
((
envVar
=
getenv
(
envVarName
))
&&
strlen
(
envVar
))
if
((
envVar
=
getenv
(
envVarName
))
&&
strlen
(
envVar
))
{
*
dirpath
=
pg_strdup
(
envVar
);
*
dirpath
=
pg_strdup
(
envVar
);
if
(
configpath
)
*
configpath
=
pg_strdup
(
envVar
);
}
else
else
pg_log
(
PG_FATAL
,
"You must identify the directory where the %s.
\n
"
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
"
,
"Please use the %s command-line option or the %s environment variable.
\n
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment