Re: error handling in cast functions for user defined types

From: Don Y <pgsql(at)DakotaCom(dot)Net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: error handling in cast functions for user defined types
Date: 2006-05-16 17:30:16
Message-ID: 446A0C28.302@DakotaCom.Net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Don Y <pgsql(at)DakotaCom(dot)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.

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

Thanks!
--don

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-05-16 17:34:12 Re: Namespace issues
Previous Message Don Y 2006-05-16 17:29:27 Namespace issues