Re: exception handling in plpgsql

Поиск
Список
Период
Сортировка
От Korry
Тема Re: exception handling in plpgsql
Дата
Msg-id 1104591897.11849.4.camel@sakai
обсуждение исходный текст
Ответ на exception handling in plpgsql  (Sibtay Abbas <sibtay_abbas@yahoo.com>)
Ответы Re: exception handling in plpgsql  (Michael Fuhr <mike@fuhr.org>)
Re: exception handling in plpgsql  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
<blockquote type="CITE"><pre>
<font color="#000000">I am using the following sytex to handle exceptions in</font>
<font color="#000000">plpgsql (I am using postgres 8 rc1)</font>

<font color="#000000">....some code ........</font>

<font color="#000000">EXCEPTION</font>
<font color="#000000">    WHEN NO_DATA THEN      </font>
<font color="#000000">       RAISE NOTICE 'NO DATA';</font>
<font color="#000000">    WHEN OTHERS THEN</font>
<font color="#000000">        RAISE NOTICE 'An exception occurred';</font>
<font color="#000000">        RETURN emp_rec;</font>

<font color="#000000">and i receive the following error </font>
<font color="#000000">ERROR:  unrecognized exception condition "no_data"</font>

<font color="#000000">How can i rectify this error?</font>
</pre></blockquote><br /> It seems you can’t trap every condition listed in errocodes-appendix.html; in particular, you
can’ttrap <tt>SUCCESSFUL_COMPLETION</tt>, any of the conditions listed in the <tt>WARNING</tt> category, or any of the
conditionslisted in the <tt>NO DATA</tt> category.  (At least through 8.0 rc1 - I haven't checked in later
versions).<br/><br />         -- Korry  

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: Where do I get the spec for PostgreSQL
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: [PATCHES] Bgwriter behavior