Re: error handling in cast functions for user defined types

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: error handling in cast functions for user defined types
Дата
Msg-id 893.1147740573@sss.pgh.pa.us
обсуждение исходный текст
Ответ на error handling in cast functions for user defined types  (Don Y <pgsql@DakotaCom.Net>)
Ответы Re: error handling in cast functions for user defined types  (Don Y <pgsql@DakotaCom.Net>)
Список pgsql-general
Don Y <pgsql@DakotaCom.Net> writes:
> I'm writing a set of casts to/from various user defined
> types.  As is unexpected, there are cases where one
> data type doesn't neatly map to another (for certain
> values).  In these cases I emit an INVALID_PARAMETER_VALUE
> or OUT_OF_RANGE error -- depending on the situation.

> But, should I also PG_RETURN_NULL()?

elog(ERROR) doesn't return to your function --- think of it as being
like exit().  So it's pointless to code anything after it.

            regards, tom lane

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

Предыдущее
От: Don Y
Дата:
Сообщение: error handling in cast functions for user defined types
Следующее
От: Brendan Duddridge
Дата:
Сообщение: Re: GUI Interface