PostgreSQL Source Code  git master
option.c File Reference
#include "postgres_fe.h"
#include <time.h>
#include "getopt_long.h"
#include "common/string.h"
#include "utils/pidfile.h"
#include "pg_upgrade.h"
Include dependency graph for option.c:

Go to the source code of this file.

Macros

#define FIX_DEFAULT_READ_ONLY   "-c default_transaction_read_only=false"
 

Functions

static void usage (void)
 
static void check_required_directory (char **dirpath, const char *envVarName, bool useCwd, const char *cmdLineOption, const char *description, bool missingOk)
 
void parseCommandLine (int argc, char *argv[])
 
void adjust_data_dir (ClusterInfo *cluster)
 
void get_sock_dir (ClusterInfo *cluster, bool live_check)
 

Variables

UserOpts user_opts
 

Macro Definition Documentation

◆ FIX_DEFAULT_READ_ONLY

#define FIX_DEFAULT_READ_ONLY   "-c default_transaction_read_only=false"

Definition at line 29 of file option.c.

Referenced by parseCommandLine().

Function Documentation

◆ adjust_data_dir()

void adjust_data_dir ( ClusterInfo cluster)

Definition at line 405 of file option.c.

References ClusterInfo::bindir, check_ok(), filename, MAX_STRING, MAXPGPATH, old_cluster, output(), pg_fatal, pg_strdup(), pg_strip_crlf(), ClusterInfo::pgconfig, ClusterInfo::pgdata, prep_status(), snprintf, and strerror.

406 {
407  char filename[MAXPGPATH];
408  char cmd[MAXPGPATH],
409  cmd_output[MAX_STRING];
410  FILE *fp,
411  *output;
412 
413  /* Initially assume config dir and data dir are the same */
414  cluster->pgconfig = pg_strdup(cluster->pgdata);
415 
416  /* If there is no postgresql.conf, it can't be a config-only dir */
417  snprintf(filename, sizeof(filename), "%s/postgresql.conf", cluster->pgconfig);
418  if ((fp = fopen(filename, "r")) == NULL)
419  return;
420  fclose(fp);
421 
422  /* If PG_VERSION exists, it can't be a config-only dir */
423  snprintf(filename, sizeof(filename), "%s/PG_VERSION", cluster->pgconfig);
424  if ((fp = fopen(filename, "r")) != NULL)
425  {
426  fclose(fp);
427  return;
428  }
429 
430  /* Must be a configuration directory, so find the real data directory. */
431 
432  if (cluster == &old_cluster)
433  prep_status("Finding the real data directory for the source cluster");
434  else
435  prep_status("Finding the real data directory for the target cluster");
436 
437  /*
438  * We don't have a data directory yet, so we can't check the PG version,
439  * so this might fail --- only works for PG 9.2+. If this fails,
440  * pg_upgrade will fail anyway because the data files will not be found.
441  */
442  snprintf(cmd, sizeof(cmd), "\"%s/postgres\" -D \"%s\" -C data_directory",
443  cluster->bindir, cluster->pgconfig);
444 
445  if ((output = popen(cmd, "r")) == NULL ||
446  fgets(cmd_output, sizeof(cmd_output), output) == NULL)
447  pg_fatal("could not get data directory using %s: %s\n",
448  cmd, strerror(errno));
449 
450  pclose(output);
451 
452  /* strip trailing newline and carriage return */
453  (void) pg_strip_crlf(cmd_output);
454 
455  cluster->pgdata = pg_strdup(cmd_output);
456 
457  check_ok();
458 }
int pg_strip_crlf(char *str)
Definition: string.c:105
static void output(uint64 loop_count)
#define pg_fatal(...)
Definition: pg_rewind.h:43
char * pgconfig
Definition: pg_upgrade.h:262
#define MAXPGPATH
void prep_status(const char *fmt,...) pg_attribute_printf(1
ClusterInfo old_cluster
Definition: pg_upgrade.c:59
char * pg_strdup(const char *in)
Definition: fe_memutils.c:85
static void check_ok(void)
Definition: initdb.c:2079
char * bindir
Definition: pg_upgrade.h:264
#define MAX_STRING
Definition: pg_upgrade.h:18
#define strerror
Definition: port.h:205
static char * filename
Definition: pg_dumpall.c:91
char * pgdata
Definition: pg_upgrade.h:261
#define snprintf
Definition: port.h:192

◆ check_required_directory()

static void check_required_directory ( char **  dirpath,
const char *  envVarName,
bool  useCwd,
const char *  cmdLineOption,
const char *  description,
bool  missingOk 
)
static

Definition at line 360 of file option.c.

References canonicalize_path(), MAXPGPATH, pg_fatal, and pg_strdup().

Referenced by parseCommandLine().

363 {
364  if (*dirpath == NULL || strlen(*dirpath) == 0)
365  {
366  const char *envVar;
367 
368  if ((envVar = getenv(envVarName)) && strlen(envVar))
369  *dirpath = pg_strdup(envVar);
370  else if (useCwd)
371  {
372  char cwd[MAXPGPATH];
373 
374  if (!getcwd(cwd, MAXPGPATH))
375  pg_fatal("could not determine current directory\n");
376  *dirpath = pg_strdup(cwd);
377  }
378  else if (missingOk)
379  return;
380  else
381  pg_fatal("You must identify the directory where the %s.\n"
382  "Please use the %s command-line option or the %s environment variable.\n",
383  description, cmdLineOption, envVarName);
384  }
385 
386  /*
387  * Clean up the path, in particular trimming any trailing path separators,
388  * because we construct paths by appending to this path.
389  */
390  canonicalize_path(*dirpath);
391 }
void canonicalize_path(char *path)
Definition: path.c:254
#define pg_fatal(...)
Definition: pg_rewind.h:43
#define MAXPGPATH
char * pg_strdup(const char *in)
Definition: fe_memutils.c:85

◆ get_sock_dir()

void get_sock_dir ( ClusterInfo cluster,
bool  live_check 
)

Definition at line 470 of file option.c.

References DEF_PGUPORT, filename, GET_MAJOR_VERSION, LOCK_FILE_LINE_PORT, LOCK_FILE_LINE_SOCKET_DIR, ClusterInfo::major_version, Max, MAXPGPATH, old_cluster, pg_fatal, pg_log(), pg_strdup(), pg_strip_crlf(), PG_WARNING, ClusterInfo::pgdata, ClusterInfo::port, snprintf, ClusterInfo::sockdir, UserOpts::socketdir, and strerror.

Referenced by main().

471 {
472 #ifdef HAVE_UNIX_SOCKETS
473 
474  /*
475  * sockdir and port were added to postmaster.pid in PG 9.1. Pre-9.1 cannot
476  * process pg_ctl -w for sockets in non-default locations.
477  */
478  if (GET_MAJOR_VERSION(cluster->major_version) >= 901)
479  {
480  if (!live_check)
481  cluster->sockdir = user_opts.socketdir;
482  else
483  {
484  /*
485  * If we are doing a live check, we will use the old cluster's
486  * Unix domain socket directory so we can connect to the live
487  * server.
488  */
489  unsigned short orig_port = cluster->port;
490  char filename[MAXPGPATH],
491  line[MAXPGPATH];
492  FILE *fp;
493  int lineno;
494 
495  snprintf(filename, sizeof(filename), "%s/postmaster.pid",
496  cluster->pgdata);
497  if ((fp = fopen(filename, "r")) == NULL)
498  pg_fatal("could not open file \"%s\": %s\n",
499  filename, strerror(errno));
500 
501  for (lineno = 1;
503  lineno++)
504  {
505  if (fgets(line, sizeof(line), fp) == NULL)
506  pg_fatal("could not read line %d from file \"%s\": %s\n",
507  lineno, filename, strerror(errno));
508 
509  /* potentially overwrite user-supplied value */
510  if (lineno == LOCK_FILE_LINE_PORT)
511  sscanf(line, "%hu", &old_cluster.port);
512  if (lineno == LOCK_FILE_LINE_SOCKET_DIR)
513  {
514  /* strip trailing newline and carriage return */
515  cluster->sockdir = pg_strdup(line);
516  (void) pg_strip_crlf(cluster->sockdir);
517  }
518  }
519  fclose(fp);
520 
521  /* warn of port number correction */
522  if (orig_port != DEF_PGUPORT && old_cluster.port != orig_port)
523  pg_log(PG_WARNING, "user-supplied old port number %hu corrected to %hu\n",
524  orig_port, cluster->port);
525  }
526  }
527  else
528 
529  /*
530  * Can't get sockdir and pg_ctl -w can't use a non-default, use
531  * default
532  */
533  cluster->sockdir = NULL;
534 #else /* !HAVE_UNIX_SOCKETS */
535  cluster->sockdir = NULL;
536 #endif
537 }
uint32 major_version
Definition: pg_upgrade.h:269
int pg_strip_crlf(char *str)
Definition: string.c:105
#define GET_MAJOR_VERSION(v)
Definition: pg_upgrade.h:23
#define pg_fatal(...)
Definition: pg_rewind.h:43
unsigned short port
Definition: pg_upgrade.h:268
#define LOCK_FILE_LINE_SOCKET_DIR
Definition: pidfile.h:41
#define MAXPGPATH
ClusterInfo old_cluster
Definition: pg_upgrade.c:59
char * pg_strdup(const char *in)
Definition: fe_memutils.c:85
UserOpts user_opts
Definition: option.c:32
#define DEF_PGUPORT
Definition: pg_upgrade.h:16
void void pg_log(eLogType type, const char *fmt,...) pg_attribute_printf(2
#define Max(x, y)
Definition: c.h:898
#define LOCK_FILE_LINE_PORT
Definition: pidfile.h:40
#define strerror
Definition: port.h:205
static char * filename
Definition: pg_dumpall.c:91
char * pgdata
Definition: pg_upgrade.h:261
char * sockdir
Definition: pg_upgrade.h:267
#define snprintf
Definition: port.h:192
char * socketdir
Definition: pg_upgrade.h:296

◆ parseCommandLine()

void parseCommandLine ( int  argc,
char *  argv[] 
)

Definition at line 41 of file option.c.

References _, ClusterInfo::bindir, canonicalize_path(), UserOpts::check, check_required_directory(), DEF_PGUPORT, filename, FIX_DEFAULT_READ_ONLY, fopen_priv, fprintf, free, get_progname(), get_user_info(), getopt_long(), LogOpts::internal, INTERNAL_LOG_FILE, UserOpts::jobs, log_opts, MAXPGPATH, new_cluster, no_argument, old_cluster, optarg, optind, os_info, output_files, path_is_prefix_of_path(), pfree(), pg_fatal, pg_free(), pg_log(), pg_putenv(), PG_REPORT, pg_strdup(), ClusterInfo::pgdata, ClusterInfo::pgopts, ClusterInfo::port, OSInfo::progname, psprintf(), required_argument, LogOpts::retain, UserOpts::socketdir, strlcpy(), UserOpts::transfer_mode, TRANSFER_MODE_CLONE, TRANSFER_MODE_COPY, TRANSFER_MODE_LINK, usage(), OSInfo::user, OSInfo::user_specified, and LogOpts::verbose.

Referenced by main().

42 {
43  static struct option long_options[] = {
44  {"old-datadir", required_argument, NULL, 'd'},
45  {"new-datadir", required_argument, NULL, 'D'},
46  {"old-bindir", required_argument, NULL, 'b'},
47  {"new-bindir", required_argument, NULL, 'B'},
48  {"old-options", required_argument, NULL, 'o'},
49  {"new-options", required_argument, NULL, 'O'},
50  {"old-port", required_argument, NULL, 'p'},
51  {"new-port", required_argument, NULL, 'P'},
52 
53  {"username", required_argument, NULL, 'U'},
54  {"check", no_argument, NULL, 'c'},
55  {"link", no_argument, NULL, 'k'},
56  {"retain", no_argument, NULL, 'r'},
57  {"jobs", required_argument, NULL, 'j'},
58  {"socketdir", required_argument, NULL, 's'},
59  {"verbose", no_argument, NULL, 'v'},
60  {"clone", no_argument, NULL, 1},
61 
62  {NULL, 0, NULL, 0}
63  };
64  int option; /* Command line option */
65  int optindex = 0; /* used by getopt_long */
66  int os_user_effective_id;
67  FILE *fp;
68  char **filename;
69  time_t run_time = time(NULL);
70 
72 
73  os_info.progname = get_progname(argv[0]);
74 
75  /* Process libpq env. variables; load values here for usage() output */
76  old_cluster.port = getenv("PGPORTOLD") ? atoi(getenv("PGPORTOLD")) : DEF_PGUPORT;
77  new_cluster.port = getenv("PGPORTNEW") ? atoi(getenv("PGPORTNEW")) : DEF_PGUPORT;
78 
79  os_user_effective_id = get_user_info(&os_info.user);
80  /* we override just the database user name; we got the OS id above */
81  if (getenv("PGUSER"))
82  {
84  /* must save value, getenv()'s pointer is not stable */
85  os_info.user = pg_strdup(getenv("PGUSER"));
86  }
87 
88  if (argc > 1)
89  {
90  if (strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") == 0)
91  {
92  usage();
93  exit(0);
94  }
95  if (strcmp(argv[1], "--version") == 0 || strcmp(argv[1], "-V") == 0)
96  {
97  puts("pg_upgrade (PostgreSQL) " PG_VERSION);
98  exit(0);
99  }
100  }
101 
102  /* Allow help and version to be run as root, so do the test here. */
103  if (os_user_effective_id == 0)
104  pg_fatal("%s: cannot be run as root\n", os_info.progname);
105 
106  while ((option = getopt_long(argc, argv, "d:D:b:B:cj:ko:O:p:P:rs:U:v",
107  long_options, &optindex)) != -1)
108  {
109  switch (option)
110  {
111  case 'b':
113  break;
114 
115  case 'B':
117  break;
118 
119  case 'c':
120  user_opts.check = true;
121  break;
122 
123  case 'd':
125  break;
126 
127  case 'D':
129  break;
130 
131  case 'j':
132  user_opts.jobs = atoi(optarg);
133  break;
134 
135  case 'k':
137  break;
138 
139  case 'o':
140  /* append option? */
141  if (!old_cluster.pgopts)
143  else
144  {
145  char *old_pgopts = old_cluster.pgopts;
146 
147  old_cluster.pgopts = psprintf("%s %s", old_pgopts, optarg);
148  free(old_pgopts);
149  }
150  break;
151 
152  case 'O':
153  /* append option? */
154  if (!new_cluster.pgopts)
156  else
157  {
158  char *new_pgopts = new_cluster.pgopts;
159 
160  new_cluster.pgopts = psprintf("%s %s", new_pgopts, optarg);
161  free(new_pgopts);
162  }
163  break;
164 
165  /*
166  * Someday, the port number option could be removed and passed
167  * using -o/-O, but that requires postmaster -C to be
168  * supported on all old/new versions (added in PG 9.2).
169  */
170  case 'p':
171  if ((old_cluster.port = atoi(optarg)) <= 0)
172  pg_fatal("invalid old port number\n");
173  break;
174 
175  case 'P':
176  if ((new_cluster.port = atoi(optarg)) <= 0)
177  pg_fatal("invalid new port number\n");
178  break;
179 
180  case 'r':
181  log_opts.retain = true;
182  break;
183 
184  case 's':
186  break;
187 
188  case 'U':
191  os_info.user_specified = true;
192 
193  /*
194  * Push the user name into the environment so pre-9.1
195  * pg_ctl/libpq uses it.
196  */
197  pg_putenv("PGUSER", os_info.user);
198  break;
199 
200  case 'v':
201  log_opts.verbose = true;
202  break;
203 
204  case 1:
206  break;
207 
208  default:
209  fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
210  os_info.progname);
211  exit(1);
212  }
213  }
214 
215  if (optind < argc)
216  pg_fatal("too many command-line arguments (first is \"%s\")\n", argv[optind]);
217 
218  if ((log_opts.internal = fopen_priv(INTERNAL_LOG_FILE, "a")) == NULL)
219  pg_fatal("could not open log file \"%s\": %m\n", INTERNAL_LOG_FILE);
220 
221  if (log_opts.verbose)
222  pg_log(PG_REPORT, "Running in verbose mode\n");
223 
224  /* label start of upgrade in logfiles */
225  for (filename = output_files; *filename != NULL; filename++)
226  {
227  if ((fp = fopen_priv(*filename, "a")) == NULL)
228  pg_fatal("could not write to log file \"%s\": %m\n", *filename);
229 
230  /* Start with newline because we might be appending to a file. */
231  fprintf(fp, "\n"
232  "-----------------------------------------------------------------\n"
233  " pg_upgrade run on %s"
234  "-----------------------------------------------------------------\n\n",
235  ctime(&run_time));
236  fclose(fp);
237  }
238 
239  /* Turn off read-only mode; add prefix to PGOPTIONS? */
240  if (getenv("PGOPTIONS"))
241  {
242  char *pgoptions = psprintf("%s %s", FIX_DEFAULT_READ_ONLY,
243  getenv("PGOPTIONS"));
244 
245  pg_putenv("PGOPTIONS", pgoptions);
246  pfree(pgoptions);
247  }
248  else
249  pg_putenv("PGOPTIONS", FIX_DEFAULT_READ_ONLY);
250 
251  /* Get values from env if not already set */
252  check_required_directory(&old_cluster.bindir, "PGBINOLD", false,
253  "-b", _("old cluster binaries reside"), false);
254  check_required_directory(&new_cluster.bindir, "PGBINNEW", false,
255  "-B", _("new cluster binaries reside"), true);
256  check_required_directory(&old_cluster.pgdata, "PGDATAOLD", false,
257  "-d", _("old cluster data resides"), false);
258  check_required_directory(&new_cluster.pgdata, "PGDATANEW", false,
259  "-D", _("new cluster data resides"), false);
260  check_required_directory(&user_opts.socketdir, "PGSOCKETDIR", true,
261  "-s", _("sockets will be created"), false);
262 
263 #ifdef WIN32
264 
265  /*
266  * On Windows, initdb --sync-only will fail with a "Permission denied"
267  * error on file pg_upgrade_utility.log if pg_upgrade is run inside the
268  * new cluster directory, so we do a check here.
269  */
270  {
271  char cwd[MAXPGPATH],
272  new_cluster_pgdata[MAXPGPATH];
273 
274  strlcpy(new_cluster_pgdata, new_cluster.pgdata, MAXPGPATH);
275  canonicalize_path(new_cluster_pgdata);
276 
277  if (!getcwd(cwd, MAXPGPATH))
278  pg_fatal("could not determine current directory\n");
279  canonicalize_path(cwd);
280  if (path_is_prefix_of_path(new_cluster_pgdata, cwd))
281  pg_fatal("cannot run pg_upgrade from inside the new cluster data directory on Windows\n");
282  }
283 #endif
284 }
const char * get_progname(const char *argv0)
Definition: path.c:453
int getopt_long(int argc, char *const argv[], const char *optstring, const struct option *longopts, int *longindex)
Definition: getopt_long.c:57
bool path_is_prefix_of_path(const char *path1, const char *path2)
Definition: path.c:438
char * psprintf(const char *fmt,...)
Definition: psprintf.c:46
int get_user_info(char **user_name_p)
Definition: util.c:212
#define FIX_DEFAULT_READ_ONLY
Definition: option.c:29
void canonicalize_path(char *path)
Definition: path.c:254
#define pg_fatal(...)
Definition: pg_rewind.h:43
unsigned short port
Definition: pg_upgrade.h:268
LogOpts log_opts
Definition: util.c:18
int jobs
Definition: pg_upgrade.h:295
#define fprintf
Definition: port.h:196
bool user_specified
Definition: pg_upgrade.h:312
char * pgopts
Definition: pg_upgrade.h:265
static void check_required_directory(char **dirpath, const char *envVarName, bool useCwd, const char *cmdLineOption, const char *description, bool missingOk)
Definition: option.c:360
ClusterInfo new_cluster
Definition: pg_upgrade.c:59
#define required_argument
Definition: getopt_long.h:25
void pfree(void *pointer)
Definition: mcxt.c:1056
int optind
Definition: getopt.c:50
#define MAXPGPATH
char * output_files[]
Definition: pg_upgrade.c:63
ClusterInfo old_cluster
Definition: pg_upgrade.c:59
char * pg_strdup(const char *in)
Definition: fe_memutils.c:85
transferMode transfer_mode
Definition: pg_upgrade.h:294
UserOpts user_opts
Definition: option.c:32
bool verbose
Definition: pg_upgrade.h:282
char * bindir
Definition: pg_upgrade.h:264
#define no_argument
Definition: getopt_long.h:24
#define DEF_PGUPORT
Definition: pg_upgrade.h:16
#define INTERNAL_LOG_FILE
Definition: pg_upgrade.h:32
#define free(a)
Definition: header.h:65
void void pg_log(eLogType type, const char *fmt,...) pg_attribute_printf(2
size_t strlcpy(char *dst, const char *src, size_t siz)
Definition: strlcpy.c:45
const char * progname
Definition: pg_upgrade.h:310
FILE * internal
Definition: pg_upgrade.h:281
bool check
Definition: pg_upgrade.h:292
void pg_free(void *ptr)
Definition: fe_memutils.c:105
static char * filename
Definition: pg_dumpall.c:91
#define fopen_priv(path, mode)
Definition: pg_upgrade.h:382
char * pgdata
Definition: pg_upgrade.h:261
char * optarg
Definition: getopt.c:52
OSInfo os_info
Definition: pg_upgrade.c:61
void pg_putenv(const char *var, const char *val)
Definition: util.c:254
bool retain
Definition: pg_upgrade.h:283
char * user
Definition: pg_upgrade.h:311
char * socketdir
Definition: pg_upgrade.h:296
#define _(x)
Definition: elog.c:84
static void usage(void)
Definition: option.c:288

◆ usage()

static void usage ( void  )
static

Definition at line 288 of file option.c.

References _, new_cluster, old_cluster, os_info, ClusterInfo::port, printf, and OSInfo::user.

Referenced by parseCommandLine().

289 {
290  printf(_("pg_upgrade upgrades a PostgreSQL cluster to a different major version.\n\n"));
291  printf(_("Usage:\n"));
292  printf(_(" pg_upgrade [OPTION]...\n\n"));
293  printf(_("Options:\n"));
294  printf(_(" -b, --old-bindir=BINDIR old cluster executable directory\n"));
295  printf(_(" -B, --new-bindir=BINDIR new cluster executable directory (default\n"
296  " same directory as pg_upgrade)\n"));
297  printf(_(" -c, --check check clusters only, don't change any data\n"));
298  printf(_(" -d, --old-datadir=DATADIR old cluster data directory\n"));
299  printf(_(" -D, --new-datadir=DATADIR new cluster data directory\n"));
300  printf(_(" -j, --jobs number of simultaneous processes or threads to use\n"));
301  printf(_(" -k, --link link instead of copying files to new cluster\n"));
302  printf(_(" -o, --old-options=OPTIONS old cluster options to pass to the server\n"));
303  printf(_(" -O, --new-options=OPTIONS new cluster options to pass to the server\n"));
304  printf(_(" -p, --old-port=PORT old cluster port number (default %d)\n"), old_cluster.port);
305  printf(_(" -P, --new-port=PORT new cluster port number (default %d)\n"), new_cluster.port);
306  printf(_(" -r, --retain retain SQL and log files after success\n"));
307  printf(_(" -s, --socketdir=DIR socket directory to use (default current dir.)\n"));
308  printf(_(" -U, --username=NAME cluster superuser (default \"%s\")\n"), os_info.user);
309  printf(_(" -v, --verbose enable verbose internal logging\n"));
310  printf(_(" -V, --version display version information, then exit\n"));
311  printf(_(" --clone clone instead of copying files to new cluster\n"));
312  printf(_(" -?, --help show this help, then exit\n"));
313  printf(_("\n"
314  "Before running pg_upgrade you must:\n"
315  " create a new database cluster (using the new version of initdb)\n"
316  " shutdown the postmaster servicing the old cluster\n"
317  " shutdown the postmaster servicing the new cluster\n"));
318  printf(_("\n"
319  "When you run pg_upgrade, you must provide the following information:\n"
320  " the data directory for the old cluster (-d DATADIR)\n"
321  " the data directory for the new cluster (-D DATADIR)\n"
322  " the \"bin\" directory for the old version (-b BINDIR)\n"
323  " the \"bin\" directory for the new version (-B BINDIR)\n"));
324  printf(_("\n"
325  "For example:\n"
326  " pg_upgrade -d oldCluster/data -D newCluster/data -b oldCluster/bin -B newCluster/bin\n"
327  "or\n"));
328 #ifndef WIN32
329  printf(_(" $ export PGDATAOLD=oldCluster/data\n"
330  " $ export PGDATANEW=newCluster/data\n"
331  " $ export PGBINOLD=oldCluster/bin\n"
332  " $ export PGBINNEW=newCluster/bin\n"
333  " $ pg_upgrade\n"));
334 #else
335  printf(_(" C:\\> set PGDATAOLD=oldCluster/data\n"
336  " C:\\> set PGDATANEW=newCluster/data\n"
337  " C:\\> set PGBINOLD=oldCluster/bin\n"
338  " C:\\> set PGBINNEW=newCluster/bin\n"
339  " C:\\> pg_upgrade\n"));
340 #endif
341  printf(_("\nReport bugs to <pgsql-bugs@lists.postgresql.org>.\n"));
342 }
unsigned short port
Definition: pg_upgrade.h:268
#define printf(...)
Definition: port.h:198
ClusterInfo new_cluster
Definition: pg_upgrade.c:59
ClusterInfo old_cluster
Definition: pg_upgrade.c:59
OSInfo os_info
Definition: pg_upgrade.c:61
char * user
Definition: pg_upgrade.h:311
#define _(x)
Definition: elog.c:84

Variable Documentation

◆ user_opts