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

Commitbda27e5

Browse files
committed
Add pg_upgrade check to make sure the user has full access permission in
the current directory; if not, throw an error.
1 parent6c19bd9 commitbda27e5

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

‎contrib/pg_upgrade/exec.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ is_server_running(const char *datadir)
9393
void
9494
verify_directories(void)
9595
{
96+
97+
if (access(".",R_OK |W_OK |X_OK)!=0)
98+
pg_log(PG_FATAL,
99+
"You must have full access permissions in the current directory.\n");
100+
96101
prep_status("Checking old data directory (%s)",old_cluster.pgdata);
97102
check_data_dir(old_cluster.pgdata);
98103
check_ok();

‎contrib/pg_upgrade/pg_upgrade.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,17 +155,13 @@ setup(char *argv0, bool live_check)
155155

156156
/* no postmasters should be running */
157157
if (!live_check&&is_server_running(old_cluster.pgdata))
158-
{
159158
pg_log(PG_FATAL,"There seems to be a postmaster servicing the old cluster.\n"
160159
"Please shutdown that postmaster and try again.\n");
161-
}
162160

163161
/* same goes for the new postmaster */
164162
if (is_server_running(new_cluster.pgdata))
165-
{
166163
pg_log(PG_FATAL,"There seems to be a postmaster servicing the new cluster.\n"
167164
"Please shutdown that postmaster and try again.\n");
168-
}
169165

170166
/* get path to pg_upgrade executable */
171167
if (find_my_exec(argv0,exec_path)<0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp