Re: [PATCHES] WIP patch - INSERT-able log statements

From: Greg Smith <gsmith(at)gregsmith(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] WIP patch - INSERT-able log statements
Date: 2007-02-19 18:58:14
Message-ID: Pine.GSO.4.64.0702191121350.18425@westnet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Mon, 19 Feb 2007, Guillaume Smet wrote:

> Why not simply put something like %log_table% in the sql file and let
> the admin replace it with sed or whatever he likes?

This is a reasonable approach. I would suggest that no special characters
be used though, so that the SQL could be used as-is by a DBA who doesn't
even know about or want to use tools like sed. I also think the default
should be a pg_ name like the pg_log I suggested, partly because I'd like
this to be completely internal one day--just push the logs into the
database directly without even passing through an external file first.
Also, something like pg_log is unlikely to cause a conflict with existing
tables. I would bet there's already databases out there with tables
called log_table, for example, but everyone already avoids naming
application tables starting with pg_.

A workable syntax might be

INSERT INTO "pg_log" ...

The redundant quotation marks will make it easier to do a search/replace
to change the table name without worrying about accidentally impacting the
text of the message, so that even people who aren't aware how to build a
regular expression that only modifies the first match will probably be OK.

I consider using the same name as the default log directory helpful, but
would understand that others might consider it confusing to overload the
name like that.

--
* Greg Smith gsmith(at)gregsmith(dot)com http://www.gregsmith.com Baltimore, MD

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2007-02-19 19:07:32 Re: Multiple Storage per Tablespace, or Volumes
Previous Message Magnus Hagander 2007-02-19 18:39:35 Re: Multiple Storage per Tablespace, or Volumes

Browse pgsql-patches by date

  From Date Subject
Next Message Heikki Linnakangas 2007-02-19 19:07:33 Re: Recalculating OldestXmin in a long-running vacuum
Previous Message Guillaume Smet 2007-02-19 18:21:00 Re: [PATCHES] WIP patch - INSERT-able log statements