Re: proposal: catch warnings

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal: catch warnings
Date: 2007-01-08 01:59:54
Message-ID: 19520.1168221594@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com> writes:
> What is problem? ANSI SQL has different model of handling exception than
> postgresql. It doesn't distinguishes between warnings and exception. Simply
> some sqlstate clases are reservated for warnings and other's for exception.
> But all sqlstate's (without '00000') can be handled via any CONTINUE, EXIT
> or UNDO handler. Exceptions are not problem.

Really? If an EXIT handler fires on a warning, does that mean the
statement giving the warning is aborted midstream, instead of being
allowed to complete?

I think that the model the SQL spec has in mind is that a warning
condition is raised only after the statement has run to completion
(which implies only one such condition per statement BTW). This is
quite at variance with our notion of WARNING. AFAICS you are not going
to be able to implement anything that works sanely if you try to take
control away at the instant of elog(WARNING). You would need to create
some infrastructure for making this happen after the statement giving
the warning is otherwise done --- which will take *much* more extensive
revisions than just hooking into elog.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-01-08 02:03:34 Re: [HACKERS] SGML index build fix
Previous Message Tom Lane 2007-01-08 01:51:22 Re: Erronous sort used in query plan