Re: [bug fix] pg_ctl always uses the same event source
От | MauMau |
---|---|
Тема | Re: [bug fix] pg_ctl always uses the same event source |
Дата | |
Msg-id | 5553938042D84B1D9B280D937B042AF8@maumau обсуждение исходный текст |
Ответ на | Re: [bug fix] pg_ctl always uses the same event source (Amit Kapila <amit.kapila16@gmail.com>) |
Ответы |
Re: [bug fix] pg_ctl always uses the same event source
|
Список | pgsql-hackers |
Hi, Amit san, From: "Amit Kapila" <amit.kapila16@gmail.com> >> [elog.c] >> Writing the default value in this file was redundant, because >> event_source >> cannot be NULL. So change >> > I think this change might not be safe as write_eventlog() gets called > from write_stderr() which might get called > before reading postgresql.conf, so the code as exists in PG might be > to handle that case or some other similar > situation where event_source is still not set. Have you confirmed in > all ways that it is never the case that > event_source is not set when the control reaches this function. Yes, you are right. I considered this again after replying to your previous mail, and found out write_stderr() calls write_eventlog(). In that case, event_source is still NULL before GUC initialization. Please find attached the patch. I put the default event source name in one place -- pg_config_manual.h, which seems the best place. This could eliminate duplicate default values in four places: pgevent.c, pg_ctl.c, elog.c, and guc.c. Thanks to your review and comment, the code got cleaner and correct. Thank you very much. Regards MauMau
Вложения
В списке pgsql-hackers по дате отправления: