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.
Regards,
Theo
______________________________________________________________________
This email, including attachments, is intended only for the addressee
and may be confidential, privileged and subject to copyright. If you
have received this email in error, please advise the sender and delete
it. If you are not the intended recipient of this email, you must not
use, copy or disclose its content to anyone. You must not copy or
communicate to others content that is confidential or subject to
copyright, unless you have the consent of the content owner.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=
=3DUS-ASCII">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version=
5.5.2654.45">
<TITLE>indentifying the database in a Postgres log file.</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2 FACE=3D"Arial">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. </FONT></P>
<P><FONT SIZE=3D2 FACE=3D"Arial">The only options available in the=
postgresql.conf are:</FONT>
<BR><FONT FACE=3D"Times New Roman">#log_connections =3D false<BR>
#log_duration =3D false<BR>
#log_pid =3D false<BR>
#log_statement =3D false<BR>
#log_timestamp =3D false<BR>
#log_hostname =3D false<BR>
#log_source_port =3D false<BR>
</FONT>
<BR><FONT FACE=3D"Times New Roman">Is this possible? Or is there a smart=
work around.</FONT>
</P>
<P><FONT FACE=3D"Times New Roman">Regards,</FONT>
<BR> <FONT FACE=3D"Times New=
Roman">Theo</FONT>
</P>
<BR>
<BR>
</BODY>
</HTML>
<table><tr><td bgcolor=3D#ffffff><font color=
=3D#000000>________________________________________________________________=
______<br>
This email, including attachments, is intended only for the addressee<br>
and may be confidential, privileged and subject to copyright. If you<br>
have received this email in error, please advise the sender and delete<br>
it. If you are not the intended recipient of this email, you must not<br>
use, copy or disclose its content to anyone. You must not copy or <br>
communicate to others content that is confidential or subject to <br>
copyright, unless you have the consent of the content owner.<br>
</font></td></tr></table>
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@no-spam | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@no-spam