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

Commitee814b4

Browse files
committed
Have initdb display relative paths to start postmaster if used to invoke
initdb, and display in a path-native way.
1 parentdb086aa commitee814b4

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

‎src/bin/initdb/initdb.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* Portions Copyright (c) 1994, Regents of the University of California
4040
* Portions taken from FreeBSD.
4141
*
42-
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.68 2004/11/27 18:51:05 tgl Exp $
42+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.69 2004/11/29 01:14:45 momjian Exp $
4343
*
4444
*-------------------------------------------------------------------------
4545
*/
@@ -216,8 +216,10 @@ do { \
216216

217217
#ifndefWIN32
218218
#defineQUOTE_PATH""
219+
#defineDIR_SEP "/"
219220
#else
220221
#defineQUOTE_PATH"\""
222+
#defineDIR_SEP "\\"
221223
#endif
222224

223225
/*
@@ -2079,6 +2081,8 @@ main(int argc, char *argv[])
20792081
char*short_version;
20802082
char*pgdenv;/* PGDATA value gotten from and sent to
20812083
* environment */
2084+
charbin_dir[MAXPGPATH];
2085+
char*pg_data_native;
20822086
staticconstchar*subdirs[]= {
20832087
"global",
20842088
"pg_xlog",
@@ -2256,6 +2260,7 @@ main(int argc, char *argv[])
22562260
}
22572261
}
22582262

2263+
pg_data_native=pg_data;
22592264
canonicalize_path(pg_data);
22602265

22612266
/*
@@ -2567,12 +2572,18 @@ main(int argc, char *argv[])
25672572
if (authwarning!=NULL)
25682573
fprintf(stderr,authwarning);
25692574

2575+
/* Get directory specification used to start this executable */
2576+
strcpy(bin_dir,argv[0]);
2577+
get_parent_directory(bin_dir);
2578+
25702579
printf(_("\nSuccess. You can now start the database server using:\n\n"
2571-
" %s%s%s/postmaster -D %s%s%s\n"
2580+
" %s%s%s%spostmaster -D %s%s%s\n"
25722581
"or\n"
2573-
" %s%s%s/pg_ctl -D %s%s%s -l logfile start\n\n"),
2574-
QUOTE_PATH,bin_path,QUOTE_PATH,QUOTE_PATH,pg_data,QUOTE_PATH,
2575-
QUOTE_PATH,bin_path,QUOTE_PATH,QUOTE_PATH,pg_data,QUOTE_PATH);
2582+
" %s%s%s%spg_ctl -D %s%s%s -l logfile start\n\n"),
2583+
QUOTE_PATH,bin_dir,QUOTE_PATH, (strlen(bin_dir)>0) ?DIR_SEP :"",
2584+
QUOTE_PATH,pg_data_native,QUOTE_PATH,
2585+
QUOTE_PATH,bin_dir,QUOTE_PATH, (strlen(bin_dir)>0) ?DIR_SEP :"",
2586+
QUOTE_PATH,pg_data_native,QUOTE_PATH);
25762587

25772588
return0;
25782589
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp