char *datcollate_literal;
char *datctype_literal;
char *daticulocale_literal = NULL;
+ char *daticulocale_src;
DbLocaleInfo *locale = old_cluster.template0;
prep_status("Setting locale and encoding for new cluster");
datctype_literal = PQescapeLiteral(conn_new_template1,
locale->db_ctype,
strlen(locale->db_ctype));
- if (locale->db_iculocale)
- daticulocale_literal = PQescapeLiteral(conn_new_template1,
- locale->db_iculocale,
- strlen(locale->db_iculocale));
- else
- daticulocale_literal = pg_strdup("NULL");
+ daticulocale_src = locale->db_iculocale ? locale->db_iculocale : "NULL";
+ daticulocale_literal = PQescapeLiteral(conn_new_template1,
+ daticulocale_src,
+ strlen(daticulocale_src));
/* update template0 in new cluster */
if (GET_MAJOR_VERSION(new_cluster.major_version) >= 1500)