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

Commit80cb26b

Browse files
committed
Fix pg_controldata getopt. Fix some mistakes in pgpro_upgrade
1 parentdea6c1e commit80cb26b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

‎src/bin/pg_controldata/pg_controldata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ main(int argc, char *argv[])
122122
}
123123
}
124124

125-
while ((c=getopt(argc,argv,"D:c:m"))!=-1)
125+
while ((c=getopt(argc,argv,"D:cm"))!=-1)
126126
{
127127
switch (c)
128128
{

‎src/pgpro-upgrade/pgpro_upgrade

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ esac
2929

3030
# Check the catalog version
3131
CATALOG_VERSION_NO=2016081311
32-
MAJORVER=$9.6
32+
MAJORVER=9.6
3333
CATVER=`${PGBIN}pg_controldata|sed -n'/Catalog version number:/s/^.*: *//p'`
3434
if ["$CATVER"!=$CATALOG_VERSION_NO ];then
3535
if [!-f"${PGDATA}/global/pg_control" ];then
@@ -39,9 +39,13 @@ if [ "$CATVER" != $CATALOG_VERSION_NO ]; then
3939
s/'.*$//
4040
p}" /etc/postgresql/9.6/main/postgresql.conf`
4141
if [-z"$PGDATA"-o!-f"${PGDATA}/global/pg_control" ];then
42-
echo"Cannot find valid database in$PGDATA"2>&1;
42+
echo"Cannot find valid database in$PGDATA"1>&2;
4343
exit 1
4444
fi
45+
if [-f"$PGDATA/postmaster.pid" ];then
46+
echo"postmaster.pid exists. Is another backend running on$PGDATA"1>&2;
47+
exit 1;
48+
fi
4549
fi
4650
# Fix pg_control file
4751
"${PGBIN}pg_controldata" -c
@@ -52,7 +56,7 @@ if [ "$CATVER" != $CATALOG_VERSION_NO ]; then
5256
(cd$i; mv PG_${MAJORVER}_$CATVER PG_${MAJORVER}_$CATALOG_VERSION_NO)
5357
done
5458
)
55-
if [-n"$SAVE_PGDATA" ]then
59+
if [-n"$SAVE_PGDATA" ];then
5660
PGDATA="$SAVE_PGDATA"
5761
fi
5862
fi

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp