Re: error handling in cast functions for user defined types

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

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.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Brendan Duddridge 2006-05-16 01:01:38 Re: GUI Interface
Previous Message Don Y 2006-05-16 00:38:05 error handling in cast functions for user defined types