Return-Path: pg_adm@postgres.berkeley.edu Received: by postgres.Berkeley.EDU (5.61/1.29) id AA00613; Wed, 28 Jul 93 20:11:08 -0700 Date: Wed, 28 Jul 93 20:11:08 -0700 Message-Id: <9307290311.AA00613@postgres.Berkeley.EDU> From: jaws@pangaea.dme.nt.gov.au (James Woods 61-89-895257) Subject: functions that return nothing To: postgres@postgres.berkeley.edu Sender: pg_adm@postgres.berkeley.edu 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 jaws@pangaea.dme.nt.gov.au