|
20 | 20 | #include "utils/thread.h" |
21 | 21 | #include <time.h> |
22 | 22 |
|
23 | | -const char *PROGRAM_URL = "https://github.com/postgrespro/pg_probackup"; |
24 | | -const char *PROGRAM_EMAIL = "https://github.com/postgrespro/pg_probackup/issues"; |
25 | | -const char *PROGRAM_FULL_PATH = NULL; |
| 23 | +const char *PROGRAM_NAME = NULL; |
| 24 | +const char *PROGRAM_FULL_PATH = NULL; |
| 25 | +const char *PROGRAM_URL = "https://github.com/postgrespro/pg_probackup"; |
| 26 | +const char *PROGRAM_EMAIL = "https://github.com/postgrespro/pg_probackup/issues"; |
26 | 27 |
|
27 | 28 | typedef enum ProbackupSubcmd |
28 | 29 | { |
@@ -245,13 +246,7 @@ main(int argc, char *argv[]) |
245 | 246 | PROGRAM_NAME = get_progname(argv[0]); |
246 | 247 | PROGRAM_FULL_PATH = palloc0(MAXPGPATH); |
247 | 248 |
|
248 | | - if (find_my_exec(argv[0],(char *) PROGRAM_FULL_PATH) < 0) |
249 | | - { |
250 | | - fprintf(stderr, _("%s: could not find own program executable\n"), PROGRAM_NAME); |
251 | | - exit(1); |
252 | | - } |
253 | | - |
254 | | - set_pglocale_pgservice(argv[0], "pgscripts"); |
| 249 | + //set_pglocale_pgservice(argv[0], "pgscripts"); |
255 | 250 |
|
256 | 251 | #if PG_VERSION_NUM >= 110000 |
257 | 252 | /* |
@@ -514,6 +509,15 @@ main(int argc, char *argv[]) |
514 | 509 | command = NULL; |
515 | 510 | } |
516 | 511 |
|
| 512 | + /* For archive-push and archive-get skip full path lookup */ |
| 513 | + if ((backup_subcmd != ARCHIVE_GET_CMD && |
| 514 | + backup_subcmd != ARCHIVE_PUSH_CMD) && |
| 515 | + (find_my_exec(argv[0],(char *) PROGRAM_FULL_PATH) < 0)) |
| 516 | + { |
| 517 | + PROGRAM_FULL_PATH = NULL; |
| 518 | + elog(WARNING, "%s: could not find a full path to executable", PROGRAM_NAME); |
| 519 | + } |
| 520 | + |
517 | 521 | /* |
518 | 522 | * We have read pgdata path from command line or from configuration file. |
519 | 523 | * Ensure that pgdata is an absolute path. |
|
0 commit comments