not logging caught exceptions - Mailing list pgsql-hackers

From Peter Eisentraut
Subject not logging caught exceptions
Date
Msg-id 1257974649.22025.34.camel@vanquo.pezone.net
Whole thread Raw
Responses Re: not logging caught exceptions
List pgsql-hackers
Is it at all reasonable to try to create some mechanism so that
exceptions (elog) that are caught and not rethrown do not end up in the
log?  For example, when you write code that does something like

try   insert
catch unique_constraint_violation   update
end try

this will end up cluttering the logs with all the constraint violation
messages.

Now, we probably don't want to just suppress all logging in a TRY block
until the END_TRY.  So maybe this could be an argument to TRY or a
separate statement that would typically be run right after TRY that
names exception types to handle specially.  Higher level languages such
as PL/pgSQL could then peek ahead to the catch block to set this up.

Comments?



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Patch committers
Next
From: Joachim Wieland
Date:
Subject: Listen / Notify rewrite