Search Postgresql Archives

Re: error handling in cast functions for user defined types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tom Lane wrote:
Don Y <pgsql@xxxxxxxxxxxxx> 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.

Ah, OK.  "/* NOT REACHED */"

Thanks!
--don


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux