]> granicus.if.org Git - postgresql/commitdiff
pg_upgrade: call 'postgres' binary to get data directory location
authorBruce Momjian <bruce@momjian.us>
Wed, 1 Apr 2015 22:25:45 +0000 (18:25 -0400)
committerBruce Momjian <bruce@momjian.us>
Wed, 1 Apr 2015 22:25:45 +0000 (18:25 -0400)
This matches the binary 'pg_ctl' calls.  Previously we called the
'postmaster'.

Report by Christoph Berg

contrib/pg_upgrade/option.c

index 9b387be21d7ec2954e42ae9ca947fc24292fee08..742d133e391fe58a38188258a729bb8aa11785ac 100644 (file)
@@ -415,7 +415,7 @@ adjust_data_dir(ClusterInfo *cluster)
         * so this might fail --- only works for PG 9.2+.   If this fails,
         * pg_upgrade will fail anyway because the data files will not be found.
         */
-       snprintf(cmd, sizeof(cmd), "\"%s/postmaster\" -D \"%s\" -C data_directory",
+       snprintf(cmd, sizeof(cmd), "\"%s/postgres\" -D \"%s\" -C data_directory",
                         cluster->bindir, cluster->pgconfig);
 
        if ((output = popen(cmd, "r")) == NULL ||