Re: C function and NULL result

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: C function and NULL result
Дата
Msg-id 1248.971798330@sss.pgh.pa.us
обсуждение исходный текст
Ответ на C function and NULL result  (Victor Ivanov <v0rbiz@icon.bg>)
Ответы Re: C function and NULL result  (Victor Ivanov <v0rbiz@icon.bg>)
Список pgsql-general
Victor Ivanov <v0rbiz@icon.bg> writes:
> I'm using PostgreSQL 7.0.2 and I'm trying to create my own types with
> input and output functions in C. Everything works fine, but when the input
> is invalid and the function returns NULL, the backend crashes with SIGSEGV.

You can't return an SQL NULL by returning a NULL pointer.  Right now
there isn't a way for an input converter function to return NULL at all
(this is fixed for 7.1 though).  I'd recommend throwing an elog(ERROR)
if you don't like the input data.

            regards, tom lane

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

Предыдущее
От: Fabrice Pollet
Дата:
Сообщение: record new has no field cat
Следующее
От: Frank Bax
Дата:
Сообщение: Re: OpenBSD startup - logfile?