Re: auto-explain does not work with JSON & csvlog

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org, Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: auto-explain does not work with JSON & csvlog
Date: 2010-07-18 22:19:45
Message-ID: 21714.1279491585@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Josh Berkus <josh(at)agliodbs(dot)com> writes:
> With 9.0, the obvious thing to do with autoexplain is to log JSON or XML
> explain plans to a csvlog and then automatically process them.

BTW, I tried this and it works fine for me.

> However, when I attempt to do this, I get the following warning at
> PostgreSQL startup time:

> Loaded module "auto_explain"
> Not safe to send CSV data

FWIW, the reason for that happening is that
process_shared_preload_libraries() executes, and reports what it did,
before we fork off the syslogger process. So there's no way to CSV-ize
the "Loaded module" report. The only way to suppress that would be to
not preload libraries till after we start the syslogger, which seems
like a bad idea --- what if a library wants to be loaded in the
syslogger? Anyway, you'll get the same "not safe" bleat for any message
logged during early postmaster startup.

Maybe we should just drop the "not safe" message. It's not conveying
anything very helpful, I think. The useful bit of the behavior is to
shove the original message out to stderr, which it's doing already.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrew Dunstan 2010-07-18 23:20:15 Re: auto-explain does not work with JSON & csvlog
Previous Message Tom Lane 2010-07-18 19:40:33 Re: BUG #5564: Odd behavior with aggregate_func(DISTINCT foo ORDER BY foo)