From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>
Cc: pgsql-performance@postgresql.org
Subject: Re: indentifying the database in a Postgres log file.
Date: Wed, 15 Dec 2004 19:09:09 -0500 (EST)
Message-ID: <200412160009.iBG099v07993@candle.pha.pa.us> (raw)
In-Reply-To: <16C0CF355FA04944A69E5A4F5299D30B110E9C@ganesh.au.lpint.net>
Theo Galanakis wrote:
>
> I have written a program that parses a syslog file, reading all the postgres
> transactions. I would like to know if there is a way for postgres to log
> also the specific database the sql statement originated from.
>
> The only options available in the postgresql.conf are:
> #log_connections = false
> #log_duration = false
> #log_pid = false
> #log_statement = false
> #log_timestamp = false
> #log_hostname = false
> #log_source_port = false
>
> Is this possible? Or is there a smart work around.
In pre-8.0 the only way to do it is to log connections, grab the
database from there, and add the pid to join all log rows back to the
server row. In 8.0 we have log_line_prefix that can display all
information.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: pgman@candle.pha.pa.us, Theo.Galanakis@lonelyplanet.com.au
Subject: Re: indentifying the database in a Postgres log file.
In-Reply-To: <200412160009.iBG099v07993@candle.pha.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox