Peter Eisentraut wrote:
> On 3/3/15 7:34 PM, Jim Nasby wrote:
> > Definitely no multi-line. If we keep that restriction, couldn't we just
> > dedicate one entire line to the error message? ISTM that would be safe.
>
> But we have multiline error messages. If we put only the first line in
> the pid file, then all the tools that build on this will effectively
> show users truncated information, which won't be a good experience. If
> we don't put any error message in there, then users or tools will be
> more likely to look up the full message somewhere else.
Would it work to have it be multiline using here-doc syntax? It could
be printed similarly to what psql does to error messages, with a prefix
in front of each component (ERROR, STATEMENT, etc) and a leading tab for
continuation lines. The last line is a terminator that matches
something specified in the first error line. This becomes pretty
complicated for a PID file, mind you.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services