RE: How To Log User Name + Database? - Mailing list pgsql-general

From Edmar Wiggers
Subject RE: How To Log User Name + Database?
Date
Msg-id NEBBIAKDCDHFGJMLHCKIMEOKCBAA.edmar@brasmap.com
Whole thread Raw
In response to Re: How To Log User Name + Database?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
> Offhand I don't think that happens at the moment, but it does seem like
> it'd be a good idea to have a backend do an elog(DEBUG) at startup that
> mentions its database name and user name.  Assuming you have logging of
> timestamps/PIDs turned on, that would be enough to correlate later log
> messages with a user name.

Since each connection generates a backend process, I think the timestamp/PID
would be enough to relate log messages to an initial one saying: PID x
starting (database y, user z).

Maybe you could even include the source IP address, or whether it's an tcp
or a unix domain socket connection. Or maybe this is useless, dunno.


pgsql-general by date:

Previous
From: Zachary Beane
Date:
Subject: Re: MySQL-esque sec_to_time() function
Next
From: Tom Lane
Date:
Subject: Re: How To Log User Name + Database?