Subject: functions that return nothing

From: [email-masked] (James Woods 61-89-895257)
Date: Wed, 28 Jul 93 20:11:08 -0700

I have defined a postgres ADT in C which stores it's data in a data structure
(nothing surprising here).  This has all worked properly with the in, out and
a few other functions working properly.

What I am attempting to do now is define some functions that will extract
individual elements from my data structure.  This all works if the data
structure is full.  Unfortunately some elements of the data structure will
not always have data in them.  For these instances I wrote my function to
return NULL.  But when I try the query:

retrieve (data = some_element(table.data_item)) 

where some_element is the function returning char *
and table.data_item is of my user defined type

The system just hangs as soon as some_element() returns NULL.  I seem to
remember seeing something about not returning NULL somewhere (though it wasn't
relevant to me at the time so I have forgotten the context it was in).  If
this is so how do I return from this function if there is no data to return?
An empty string maybe (not really what I want).

thanks
James Woods
[email-masked]