summaryrefslogtreecommitdiff
path: root/contrib/pg_upgrade/pg_upgrade.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-09-03 13:52:34 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2012-09-03 13:52:40 -0400
commitf763b77193b04eba03a1f4ce46df34dc0348419e (patch)
tree3fe7b185b05f93bda47e3abdacab79763e00d04b /contrib/pg_upgrade/pg_upgrade.h
parentc1f3c045cdc97fc74e571d4e8705f7dbe7e1ec8b (diff)
Fix pg_upgrade to cope with non-default unix_socket_directory scenarios.
When starting either an old or new postmaster, force it to place its Unix socket in the current directory. This makes it even harder for accidental connections to occur during pg_upgrade, and also works around some scenarios where the default socket location isn't usable. (For example, if the default location is something other than "/tmp", it might not exist during "make check".) When checking an already-running old postmaster, find out its actual socket directory location from postmaster.pid, if possible. This dodges problems with an old postmaster having a configured location different from the default built into pg_upgrade's libpq. We can't find that out if the old postmaster is pre-9.1, so also document how to cope with such scenarios manually. In support of this, centralize handling of the connection-related command line options passed to pg_upgrade's subsidiary programs, such as pg_dump. This should make future changes easier. Bruce Momjian and Tom Lane
Diffstat (limited to 'contrib/pg_upgrade/pg_upgrade.h')
-rw-r--r--contrib/pg_upgrade/pg_upgrade.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/pg_upgrade/pg_upgrade.h b/contrib/pg_upgrade/pg_upgrade.h
index fa4c6c0a478..7b19d916fff 100644
--- a/contrib/pg_upgrade/pg_upgrade.h
+++ b/contrib/pg_upgrade/pg_upgrade.h
@@ -226,6 +226,7 @@ typedef struct
char *bindir; /* pathname for cluster's executable directory */
char *pgopts; /* options to pass to the server, like pg_ctl
* -o */
+ char *sockdir; /* directory for Unix Domain socket, if any */
unsigned short port; /* port number where postmaster is waiting */
uint32 major_version; /* PG_VERSION of cluster */
char major_version_str[64]; /* string PG_VERSION of cluster */
@@ -387,6 +388,7 @@ void print_maps(FileNameMap *maps, int n,
void parseCommandLine(int argc, char *argv[]);
void adjust_data_dir(ClusterInfo *cluster);
+void get_sock_dir(ClusterInfo *cluster, bool live_check);
/* relfilenode.c */
@@ -407,6 +409,8 @@ PGresult *
executeQueryOrDie(PGconn *conn, const char *fmt,...)
__attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3)));
+char *cluster_conn_opts(ClusterInfo *cluster);
+
void start_postmaster(ClusterInfo *cluster);
void stop_postmaster(bool fast);
uint32 get_major_server_version(ClusterInfo *cluster);