Returning null from Userdefined C function

Поиск
Список
Период
Сортировка
От Andrew Selle
Тема Returning null from Userdefined C function
Дата
Msg-id 20000811152921.C27329@upl.cs.wisc.edu
обсуждение исходный текст
Ответы Re: Returning null from Userdefined C function  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
I'm trying to write a function that takes a text input and returns
a text output.  I can get this to work.  The problem is that I want
to return NULL when the input string doesn't match the criteria I
desire.  Unfortunately, returning NULL seems to crash the backend.
i.e. if I did

#include "postgres.h"
text * andytest ( text * str )
{ return NULL;
}

The backend would quit unexpectantly when I ran
select andytest('fds');
or select andytest(NULL);

Obviously, there must be some way to create a NULL text * return 
variable, but I haven't been able to find it.  I've looked at all
the code I've been able to find to no avail.

-Andy


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "G. Anthony Reina"
Дата:
Сообщение: Re: Input strings > 16 K?
Следующее
От: Louis-David Mitterrand
Дата:
Сообщение: Re: Off topic 'C' question