mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +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:
@ -316,3 +316,19 @@ win32_pghardlink(const char *src, const char *dst)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* fopen() file with no group/other permissions */
|
||||
FILE *
|
||||
fopen_priv(const char *path, const char *mode)
|
||||
{
|
||||
mode_t old_umask = umask(S_IRWXG | S_IRWXO);
|
||||
FILE *fp;
|
||||
|
||||
fp = fopen(path, mode);
|
||||
umask(old_umask);
|
||||
|
||||
return fp;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user