mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Replace pg_asprintf() with psprintf().
This eliminates an awkward coding pattern that's also unnecessarily inconsistent with backend coding. psprintf() is now the thing to use everywhere.
This commit is contained in:
@ -458,10 +458,9 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
|
||||
prep_status("Creating script to analyze new cluster");
|
||||
|
||||
if (os_info.user_specified)
|
||||
pg_asprintf(&user_specification, "-U \"%s\" ", os_info.user);
|
||||
user_specification = psprintf("-U \"%s\" ", os_info.user);
|
||||
|
||||
pg_asprintf(analyze_script_file_name, "analyze_new_cluster.%s",
|
||||
SCRIPT_EXT);
|
||||
*analyze_script_file_name = psprintf("analyze_new_cluster.%s", SCRIPT_EXT);
|
||||
|
||||
if ((script = fopen_priv(*analyze_script_file_name, "w")) == NULL)
|
||||
pg_fatal("Could not open file \"%s\": %s\n",
|
||||
@ -592,8 +591,7 @@ create_script_for_old_cluster_deletion(char **deletion_script_file_name)
|
||||
int tblnum;
|
||||
char old_cluster_pgdata[MAXPGPATH];
|
||||
|
||||
pg_asprintf(deletion_script_file_name, "delete_old_cluster.%s",
|
||||
SCRIPT_EXT);
|
||||
*deletion_script_file_name = psprintf("delete_old_cluster.%s", SCRIPT_EXT);
|
||||
|
||||
/*
|
||||
* Some users (oddly) create tablespaces inside the cluster data
|
||||
|
Reference in New Issue
Block a user