Обсуждение: Prevent application log pollution with notice messages

Поиск
Список
Период
Сортировка

Prevent application log pollution with notice messages

От
"Andrus"
Дата:
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.



Re: Prevent application log pollution with notice messages

От
"Magnus Hagander"
Дата:
> 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

Re: Prevent application log pollution with notice messages

От
"Andrus"
Дата:
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.



Re: Prevent application log pollution with notice messages

От
Tom Lane
Дата:
"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