From: Tom Lane <tgl@sss.pgh.pa.us>
To: George Pavlov <gpavlov@mynewplace.com>
Cc: pgsql-general@postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: Re: query log corrupted-looking entries
Date: Tue, 17 Oct 2006 17:09:12 -0400
Message-ID: <11790.1161119352@sss.pgh.pa.us> (raw)
In-Reply-To: <8C5B026B51B6854CBE88121DBF097A8651DDE7@ehost010-33.exch010.intermedia.net>
References: <8C5B026B51B6854CBE88121DBF097A8651DDE7@ehost010-33.exch010.intermedia.net>
"George Pavlov" <gpavlov@mynewplace.com> writes:
>> Hmm. If the messages are less than PIPE_BUF bytes long (4096 bytes on
>> Linux) then the writes are supposed to be atomic.
> Some of them involve long messages (>4K), but there are many that do not
> (like the ones I had posted at the start of this thread).
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));
Anyone have any comments on possible portability risks? In particular,
will this work on Windows?
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, gpavlov@mynewplace.com, pgsql-general@postgresql.org
Subject: Re: query log corrupted-looking entries
In-Reply-To: <11790.1161119352@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox