Andrew Dunstan wrote:
> The situation with this patch is that I now have it in a state where I
> think it could be applied, but there is one blocker, namely that we do
> not have a way of preventing the interleaving of log messages from
> different backends, which leads to garbled logs. This is an existing
> issue about which we have had complaints, but it becomes critical for a
> facility the whole purpose of which is to provide logs in a format
> guaranteed to work with our COPY command.
>
> Unfortunately, there is no solution in sight for this problem, certainly
> not one which I think can be devised and implemented simply at this
> stage of the cycle. The solution we'd like to use, LWLocks, is not
> workable in his context. In consequence, I don't think we have any
> option but to shelve this item for the time being.
I think this will get shot down, but here goes anyway...
How about creating a log-writing-process? Postmaster could write to the
log files directly until the log-writer is up and running, then all
processes can send their log output through the log-writer.