log database in which error occurs - Mailing list pgsql-general

From Alexander Pyhalov
Subject log database in which error occurs
Date
Msg-id 4BE90D01.1040506@rsu.ru
Whole thread Raw
Responses Re: log database in which error occurs
List pgsql-general
Hello.
We have postgresql 8.4 server with about 40 databases. Postgres logs
error statements, but it's quite difficult to determine which users on
which databases caused error. For example, this is a piece of log:

May 11 01:36:46 pgsql pgsql[73794]: [7-1] ERROR:  42601: syntax error at
or near  "(" at character 50
May 11 01:36:46 pgsql pgsql[73794]: [7-2] LOCATION:  base_yyerror,
scan.l:907
May 11 01:36:46 pgsql pgsql[73794]: [7-3] STATEMENT:  select count(*)
from forum_msg where grp_id=6709 (200 ok) ACCEPTED and is_blocked='f'

Are there any ways to log database, to which invalid query was issued ?
Are there any ways to separate general server errors and errors per each
database in several log files? I'd like general errors like SEVERE ones
to go to the /var/log/postgresql/general.log, and per-db errors on user
queries go to the /var/log/postgresql/db_$dbname.log .


--
Best regards,
Alexander Pyhalov,
system administrator of Computer Center of South Federal University

pgsql-general by date:

Previous
From: venu madhav
Date:
Subject: Re: Performance issues when the number of records are around 10 Million
Next
From: "A. Kretschmer"
Date:
Subject: Re: log database in which error occurs