Prevent application log pollution with notice messages

Started by Andrusover 20 years ago4 messagesgeneral
Jump to latest
#1Andrus
eetasoft@online.ee

My appl creates temporary table with primary key which exists only during
transaction.

Each creation of such table causes Postgres to write an entry to Windows
application log file like:

NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index
"taitmata_pkey" for table "taitmata"

I have lot of transactions and those messages will pollute application log
totally.

How to disable those notices for temporary tables ?

Also:

They cannot be filterad out since all Postgres log entries have type Error,
e.q.
LOG: database system is ready message is Erorr message !

Why postgres uses Error category for NOTICES ? Is'nt it reasonable to
use Information type ?

Andrus.

#2Magnus Hagander
magnus@hagander.net
In reply to: Andrus (#1)
Re: Prevent application log pollution with notice messages

Also:

They cannot be filterad out since all Postgres log entries
have type Error, e.q.
LOG: database system is ready message is Erorr message !

Why postgres uses Error category for NOTICES ? Is'nt it
reasonable to use Information type ?

This should be fixed in 8.0.4, and in 8.1.

//Magnus

#3Andrus
eetasoft@online.ee
In reply to: Magnus Hagander (#2)
Re: Prevent application log pollution with notice messages

Magnus,

thank you. How about the main problem:

I have two commands like

CREATE TEMP TABLE tasutud1 (dokumnr INTEGER PRIMARY KEY, tasutud NUMERIC(1))
ON COMMIT DROP;

in my transaction.

This command causes NOTICE message written to the log file.
There a number of transactions per second. So Postgres writes number notice
messages in every second.

I don't see any reason for writing notice messages in this case. Small ON
COMMIT DROP table will never written to disk, it exists only during
transaction. It is not reasonable to write information about Postgres
internal temporary memory structures to log.

Can you apply a patch which disables
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index messages at
all or at least for temporary tables, please ?

Andrus.

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrus (#3)
Re: Prevent application log pollution with notice messages

"Andrus" <eetasoft@online.ee> writes:

I don't see any reason for writing notice messages in this case.

So increase log_min_messages. (I'm not real sure why that defaults
to NOTICE, either, except perhaps habit.)

regards, tom lane