error handling in cast functions for user defined types

From: Don Y <pgsql(at)DakotaCom(dot)Net>
To: pgsql-general(at)postgresql(dot)org
Subject: error handling in cast functions for user defined types
Date: 2006-05-16 00:38:05
Message-ID: 44691EED.4010600@DakotaCom.Net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

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()? I note the
cast of int4's to int2's signal similar errors -- *but*
returns "(int2) value".

Is the return value just *ignored* when the error is
signaled?

Thanks!
--don

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-05-16 00:49:33 Re: error handling in cast functions for user defined types
Previous Message Kris Jurka 2006-05-15 23:39:38 Re: parameter passing from java program