Обсуждение: Conflicted names of error conditions.

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

Conflicted names of error conditions.

От
Dmitriy Igrishin
Дата:
Hey all,<br /><br />According to <a
href="http://www.postgresql.org/docs/9.0/static/errcodes-appendix.html">http://www.postgresql.org/docs/9.0/static/errcodes-appendix.html</a><br
/>someerror conditions has non-unique *names*. There are:<br /> modifying_sql_data_not_permitted,<br
/>prohibited_sql_statement_attempted,<br/>reading_sql_data_not_permitted<br />from <span class="bold"><span
class="EMPHASIS">SQLRoutine Exception and </span></span><span class="bold"><span class="EMPHASIS">External Routine
Exceptionclasses.<br /><br />It should be?<br /><br />Regards,<br />Dmitriy<br /><br /></span></span> 

Re: Conflicted names of error conditions.

От
Tom Lane
Дата:
Dmitriy Igrishin <dmitigr@gmail.com> writes:
> According to
> http://www.postgresql.org/docs/9.0/static/errcodes-appendix.html
> some error conditions has non-unique *names*. There are:
> modifying_sql_data_not_permitted,
> prohibited_sql_statement_attempted,
> reading_sql_data_not_permitted
> from SQL Routine Exception and External Routine Exception classes.

> It should be?

Yup, that's what the SQL standard calls them :-(.  In practice, either
underlying SQLSTATE will match that name in an EXCEPTION block, so
it doesn't matter a whole lot.  If you have a case where you feel it
does matter, you can trap by the SQLSTATE code instead.
        regards, tom lane


Re: Conflicted names of error conditions.

От
Dmitriy Igrishin
Дата:
Thanks for you answer, Tom!

I've implemented mapping between SQLSTATE codes and C++ exception
classes of my library. And of course, I've resolved the conflict of names
by giving a proper name to my classes.

Regards,
Dmitriy

2010/8/16 Tom Lane <tgl@sss.pgh.pa.us>
Dmitriy Igrishin <dmitigr@gmail.com> writes:
> According to
> http://www.postgresql.org/docs/9.0/static/errcodes-appendix.html
> some error conditions has non-unique *names*. There are:
> modifying_sql_data_not_permitted,
> prohibited_sql_statement_attempted,
> reading_sql_data_not_permitted
> from SQL Routine Exception and External Routine Exception classes.

> It should be?

Yup, that's what the SQL standard calls them :-(.  In practice, either
underlying SQLSTATE will match that name in an EXCEPTION block, so
it doesn't matter a whole lot.  If you have a case where you feel it
does matter, you can trap by the SQLSTATE code instead.

                       regards, tom lane