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
878b74e0
Commit
878b74e0
authored
14 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
In pg_upgrade, remove unnecessary local variable.
parent
0a5d5a49
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/pg_upgrade/server.c
+4
-4
4 additions, 4 deletions
contrib/pg_upgrade/server.c
with
4 additions
and
4 deletions
contrib/pg_upgrade/server.c
+
4
−
4
View file @
878b74e0
...
@@ -101,27 +101,27 @@ executeQueryOrDie(PGconn *conn, const char *fmt,...)
...
@@ -101,27 +101,27 @@ executeQueryOrDie(PGconn *conn, const char *fmt,...)
/*
/*
* get_major_server_version()
* get_major_server_version()
*
*
* gets the version (in unsigned int form) for the given
"
datadir
"
. Assumes
* gets the version (in unsigned int form) for the given datadir. Assumes
* that datadir is an absolute path to a valid pgdata directory. The version
* that datadir is an absolute path to a valid pgdata directory. The version
* is retrieved by reading the PG_VERSION file.
* is retrieved by reading the PG_VERSION file.
*/
*/
uint32
uint32
get_major_server_version
(
ClusterInfo
*
cluster
)
get_major_server_version
(
ClusterInfo
*
cluster
)
{
{
const
char
*
datadir
=
cluster
->
pgdata
;
FILE
*
version_fd
;
FILE
*
version_fd
;
char
ver_filename
[
MAXPGPATH
];
char
ver_filename
[
MAXPGPATH
];
int
integer_version
=
0
;
int
integer_version
=
0
;
int
fractional_version
=
0
;
int
fractional_version
=
0
;
snprintf
(
ver_filename
,
sizeof
(
ver_filename
),
"%s/PG_VERSION"
,
datadir
);
snprintf
(
ver_filename
,
sizeof
(
ver_filename
),
"%s/PG_VERSION"
,
cluster
->
pgdata
);
if
((
version_fd
=
fopen
(
ver_filename
,
"r"
))
==
NULL
)
if
((
version_fd
=
fopen
(
ver_filename
,
"r"
))
==
NULL
)
return
0
;
return
0
;
if
(
fscanf
(
version_fd
,
"%63s"
,
cluster
->
major_version_str
)
==
0
||
if
(
fscanf
(
version_fd
,
"%63s"
,
cluster
->
major_version_str
)
==
0
||
sscanf
(
cluster
->
major_version_str
,
"%d.%d"
,
&
integer_version
,
sscanf
(
cluster
->
major_version_str
,
"%d.%d"
,
&
integer_version
,
&
fractional_version
)
!=
2
)
&
fractional_version
)
!=
2
)
pg_log
(
PG_FATAL
,
"could not get version from %s
\n
"
,
data
dir
);
pg_log
(
PG_FATAL
,
"could not get version from %s
\n
"
,
cluster
->
pg
data
);
fclose
(
version_fd
);
fclose
(
version_fd
);
...
...
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