Re: How to trap invalid enum input exception?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How to trap invalid enum input exception?
Дата
Msg-id 12693.1281931126@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: How to trap invalid enum input exception?  (Leon Starr <leon_starr@modelint.com>)
Ответы Re: How to trap invalid enum input exception?  (Leon Starr <leon_starr@modelint.com>)
Список pgsql-novice
Leon Starr <leon_starr@modelint.com> writes:
> I have tried catching following with no success:
>     INVALID_TEXT_REPRESENTATION
>     SQLSTATE '22P02'
>     SQLSTATE '22000'
>     DATA_EXCEPTION
>     OTHERS

> (lest we think I am completely incompetent ;), I have had success
> catching all manner of FOREIGN_KEY_VIOLATION, UNIQUE_VIOLATION, CHECK_VIOLATION, NO_DATA_FOUND, etc. in other
functions.  So something is very different about this particular exception!) 

> It seems to me that it is not a normal exception and evades the exception clause.  Any thoughts on where to go from
here?

Hmm, maybe the error is not being thrown when/where you think it is?
Coercions of constants, in particular, happen very early and might
possibly need some contortions to catch.  Could we see an exact example
of what's not working for you?

            regards, tom lane

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

Предыдущее
От: Leon Starr
Дата:
Сообщение: Re: How to trap invalid enum input exception?
Следующее
От: Josh Kupershmidt
Дата:
Сообщение: Re: Listing Schemas - Revisited