Re: WIP patch - INSERT-able log statements

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Guillaume Smet <guillaume(dot)smet(at)gmail(dot)com>
Cc: Greg Smith <gsmith(at)gregsmith(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: WIP patch - INSERT-able log statements
Date: 2007-02-19 15:33:36
Message-ID: 20070219153336.GI28395@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Guillaume Smet escribió:
> On 2/19/07, Alvaro Herrera <alvherre(at)commandprompt(dot)com> wrote:
> >Please don't do that. We already have a "combined GUC option" that is
> >used to change two different things (DateStyle) and I regularly see
> >people confused about how to use it.
>
> Perhaps I don't understand your "combined GUC option" but ISTM it's
> already the case for log_destination. I don't use this ability but the
> current comment in postgresql.conf seems to be self explanatory:
> log_destination = 'syslog' # Valid values are combinations of
> # stderr, syslog and eventlog,
> # depending on platform.

That defines one thing: where does the log output go. It can be syslog,
stderr, eventlog, or any combination thereof. But it's only one thing
that you're configuring.

In datestyle, you set two things: output format and input format.
That's problematic because people changes one of the settings and then
expect the other to change too, and get confused because it doesn't
work. What I'm saying is that this was not a very good design and
please let's not repeat the mistake here.

> >Also, "sql" is not really a destination -- it is a format. Maybe have a
> >"format=plain,sql" GUC var is best: plain format is logged as currently,
> >and SQL format is logged somewhere else (maybe use the same name, and
> >stash a .sql suffix to the filename, or use .sql.log). That way you can
> >choose to have one or the other, or both if you're really dumb.
>
> I don't see how you will deal with your format GUC variable. Or it
> won't be possible to have plain and sql at the same time? My problem
> is how you will separate plain and sql if you put them in the stderr
> or syslog.

Well, to syslog or eventlog you don't send the SQL format, only plain.
If you configure the SQL format, then it's expected that stderr is
enabled, so it would be an error if you enable SQL format but not
stderr. If redirect_stderr is also enabled then you could enable both
plain format and SQL format, and have each logged to a different file
(though I repeat that IMHO that would be a dumb thing to do).

> The configuration which may interest me at first is to have syslog
> plain text output to run pgFouine daily and from time to time use the
> SQL output (I won't be able to insert into a db my daily logs so I
> will do it sometimes if I need more details, ability to look for a
> particular query and so on).
> I don't know how other people plan to use it though.

I don't think the syslog option is so nice to use these days; the
redirect_stderr stuff is more powerful and easy to use.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2007-02-19 15:40:39 Re: pg_proc without oid?
Previous Message Tom Lane 2007-02-19 15:33:24 Re: Multiple Storage per Tablespace, or Volumes

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2007-02-19 15:38:47 Re: further bootstrap cleanup
Previous Message Heikki Linnakangas 2007-02-19 14:39:45 Re: further bootstrap cleanup