aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gistproc.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2021-10-08 11:08:35 +0900
committerMichael Paquier <michael@paquier.xyz>2021-10-08 11:08:35 +0900
commit8b76f89c37973082b3d64f5a27937efcca9d65f6 (patch)
tree4be0e9020ab54beedb1e7c4fab97ef347cded208 /src/backend/access/gist/gistproc.c
parent08e2daf06c71881415ebd19105a8fe53f6eb2f8f (diff)
downloadpostgresql-8b76f89c37973082b3d64f5a27937efcca9d65f6.tar.gz
postgresql-8b76f89c37973082b3d64f5a27937efcca9d65f6.zip
Refactor fallback to stderr for csvlog to handle better WIN32 service case
send_message_to_server_log() would force a redirection of a log entry to stderr in some cases for csvlog, like the syslogger not being available yet. If this happens, csvlog would fall back to stderr to log some information rather than nothing. The code was organized so as stderr is done before csvlog, with csvlog checking that stderr did not happen yet with a reversed condition. With this code organization, it could be possible to lose some messages if running Postgres as a service on WIN32, as there is no usable stderr, and the handling of the StringInfoData holding the message for stderr was rather confusing because of that. This commit moves the csvlog handling to be before stderr, as as we are able to track down if it is necessary to log something to stderr. The reduces the handling of stderr to be in a single code path, adding a fallback to event logs for a WIN32 service. This also simplifies the way we handle the StringInfoData for stderr, making easier the integration of new file-based log destinations. I got to play with services and event logs on Windows while checking this change. Reviewed-by: Chris Bandy Discussion: https://postgr.es/m/YV0vwBovEKf1WXkl@paquier.xyz
Diffstat (limited to 'src/backend/access/gist/gistproc.c')
0 files changed, 0 insertions, 0 deletions