Re: logging as inserts

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, jd(at)commandprompt(dot)com
Subject: Re: logging as inserts
Date: 2005-03-03 19:23:25
Message-ID: 10378.1109877805@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Josh Berkus <josh(at)agliodbs(dot)com> writes:
>> What would we like the postgresql.conf option to be? I was thinking
>> log_statements_as_inserts = (t/f)

> Nope.

> log_destination = 'inserts' #not a new GUC!

That seems a bit bizarre to me. The facility isn't a new log
destination; what it is is a different way of formatting what's
sent to the log.

> insert_columns = '%u,%d,%r,%p, ... %$'
> #this new GUC would define a list of comma-seperated columns as escape codes
> defined via the same code set as log_line_prefix. The only change would be
> the addition of %$, which would symbolize the "statement" being logged.

I think what you'd probably really want to write is something like

log_message_format = 'INSERT INTO mytab VALUES(%this, %that, ...);'

the point being that otherwise we'll need yet another GUC var to determine
the table name used in the INSERT. With a suitable set of escape codes
we could probably arrange for the existing behavior to correspond
to a particular value of log_message_format, and then there isn't
anything weird going on here; you are just changing away from a default
format.

I wonder whether this could be defined in a way that lets it replace
log_line_prefix ... otherwise we have to think about the interaction of
the two facilities.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2005-03-03 19:47:59 unexpected and reproducable crash in pl/pgsql function
Previous Message Josh Berkus 2005-03-03 17:24:05 Re: logging as inserts