diff options
Diffstat (limited to 'contrib/pg_upgrade/tablespace.c')
-rw-r--r-- | contrib/pg_upgrade/tablespace.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/contrib/pg_upgrade/tablespace.c b/contrib/pg_upgrade/tablespace.c index 229f4a8fde3..f090f62b29c 100644 --- a/contrib/pg_upgrade/tablespace.c +++ b/contrib/pg_upgrade/tablespace.c @@ -84,12 +84,9 @@ set_tablespace_directory_suffix(ClusterInfo *cluster) else { /* This cluster has a version-specific subdirectory */ - cluster->tablespace_suffix = pg_malloc(4 + - strlen(cluster->major_version_str) + - 10 /* OIDCHARS */ + 1); /* The leading slash is needed to start a new directory. */ - sprintf(cluster->tablespace_suffix, "/PG_%s_%d", cluster->major_version_str, - cluster->controldata.cat_ver); + pg_asprintf(&cluster->tablespace_suffix, "/PG_%s_%d", + cluster->major_version_str, cluster->controldata.cat_ver); } } |