mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
In pg_upgrade, add various logging improvements:
add ability to control permissions of created files have psql echo its queries for easier debugging output four separate log files, and delete them on success add -r/--retain option to keep log files after success make logs file append-only remove -g/-G/-l logging options sugggest tailing appropriate log file on failure enhance -v/--verbose behavior
This commit is contained in:
@ -28,8 +28,7 @@ new_9_0_populate_pg_largeobject_metadata(ClusterInfo *cluster, bool check_mode)
|
||||
|
||||
prep_status("Checking for large objects");
|
||||
|
||||
snprintf(output_path, sizeof(output_path), "%s/pg_largeobject.sql",
|
||||
os_info.cwd);
|
||||
snprintf(output_path, sizeof(output_path), "pg_largeobject.sql");
|
||||
|
||||
for (dbnum = 0; dbnum < cluster->dbarr.ndbs; dbnum++)
|
||||
{
|
||||
@ -49,7 +48,7 @@ new_9_0_populate_pg_largeobject_metadata(ClusterInfo *cluster, bool check_mode)
|
||||
found = true;
|
||||
if (!check_mode)
|
||||
{
|
||||
if (script == NULL && (script = fopen(output_path, "w")) == NULL)
|
||||
if (script == NULL && (script = fopen_priv(output_path, "w")) == NULL)
|
||||
pg_log(PG_FATAL, "could not open file \"%s\": %s\n", output_path, getErrorText(errno));
|
||||
fprintf(script, "\\connect %s\n",
|
||||
quote_identifier(active_db->db_name));
|
||||
|
Reference in New Issue
Block a user