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 [EMAIL PROTECTED] http://www.gregsmith.com Baltimore, MD

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to