Re: [PATCHES] WIP patch - INSERT-able log statements - Mailing list pgsql-hackers

From Greg Smith
Subject Re: [PATCHES] WIP patch - INSERT-able log statements
Date
Msg-id Pine.GSO.4.64.0702191121350.18425@westnet.com
Whole thread Raw
Responses Re: [PATCHES] WIP patch - INSERT-able log statements
List pgsql-hackers
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@gregsmith.com http://www.gregsmith.com Baltimore, MD


pgsql-hackers by date:

Previous
From: August Zajonc
Date:
Subject: Re: New feature request: FlashBack Query
Next
From: Peter Eisentraut
Date:
Subject: Re: Multiple Storage per Tablespace, or Volumes