Re: logging as inserts

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: josh(at)agliodbs(dot)com
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, jd(at)commandprompt(dot)com
Subject: Re: logging as inserts
Date: 2005-03-03 22:45:29
Message-ID: 42279389.8000704@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Josh Berkus wrote:

>Tom,
>
>
>
>>But log_line_prefix works fine for all destinations, which is exactly
>>why this new facility isn't a destination. You're just confusing
>>matters by wanting to treat it as one.
>>
>>
>
>Hmmm ... hey, if we just allowed extra text in log_line_prefix, and allowed %$
>to enclose the statement with literal quoting, you could do this all through
>log_line_prefix, as:
>
>log_line_prefix='INSERT INTO pg_log VALUES ( %u, %p, ''%t'', ''%$'')'
>
>

You can have extra text today, apart from the fact that there's no
escape for the statement. try it and see. log_line_prefix is (not
coincidentally) very similar to a printf-type format string. Indeed, use
of admin-supplied fixed text was always intended - see the discussions
that led up to it.

Incidentally, %$ doesn't tstrike me as ideal - to conform to the way the
rest are done we should use an alphabetic character, not $.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2005-03-03 23:43:14 Re: logging as inserts
Previous Message Josh Berkus 2005-03-03 22:14:50 Re: logging as inserts