Database name in the log

Started by Michal Taborskyalmost 22 years ago2 messagesgeneral
Jump to latest
#1Michal Taborsky
michal@taborsky.cz

Is it possible to put a database name in slow query log? We have many
databases in our cluster and it is sometimes hard to quess which
database was the query run on.

We have:
2004-06-21 12:08:50 [89103] LOG: 00000: duration: 895.794 ms
statement: SELECT id FROM fragment [...query continues...]

I would like to have something like:

2004-06-21 12:08:50 [89103] [dbname] LOG: 00000: duration: 895.794 ms
statement: SELECT id FROM fragment [...query continues...]

Did I overlook something in the docs? Is it possible? And if not, take
it as a feature request :).

Thanks.

--
Michal Taborsky
http://www.taborsky.cz

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Michal Taborsky (#1)
Re: Database name in the log

=?ISO-8859-1?Q?Michal_T=E1borsk=FD?= <michal@taborsky.cz> writes:

Is it possible to put a database name in slow query log?

7.5 will have a feature for this, but in existing releases you'd have to
hack up elog.c to do it.

regards, tom lane