not logging caught exceptions

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: not logging caught exceptions
Date: 2009-11-11 21:24:09
Message-ID: 1257974649.22025.34.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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?

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joachim Wieland 2009-11-11 21:25:05 Listen / Notify rewrite
Previous Message Robert Haas 2009-11-11 21:21:59 Re: Patch committers