Re: [GENERAL] query log corrupted-looking entries
От | Tom Lane |
---|---|
Тема | Re: [GENERAL] query log corrupted-looking entries |
Дата | |
Msg-id | 29860.1161202644@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: [GENERAL] query log corrupted-looking entries (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: [GENERAL] query log corrupted-looking entries
|
Список | pgsql-hackers |
I wrote: > I checked around with some kernel/glibc gurus in Red Hat, and the > consensus seemed to be that we'd be better off to bypass fprintf() and > just send message strings to stderr using write() --- ie, instead of > elog.c doing > fprintf(stderr, "%s", buf.data); > do > write(fileno(stderr), buf.data, strlen(buf.data)); I did some strace'ing of the backend, and observed that even for very long messages (upwards of 100K) the fprintf results in a single write() call. This was true on both Fedora Core 5 and a pretty old HPUX version. So it'd seem that most versions of libc already know about optimizing fprintf-%s into a direct write(), and changing our code wouldn't change the behavior. It'd be interesting to verify whether it's the same on George's machine though. regards, tom lane
В списке pgsql-hackers по дате отправления: