Re: C function and NULL result

Поиск
Список
Период
Сортировка
От Victor Ivanov
Тема Re: C function and NULL result
Дата
Msg-id 20001018102505.A88421@icon.icon-bg.net
обсуждение исходный текст
Ответ на Re: C function and NULL result  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: C function and NULL result  (Karel Zak <zakkr@zf.jcu.cz>)
Список pgsql-general
On Tue, Oct 17, 2000 at 11:58:50AM -0400, Tom Lane wrote:
> 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.

Does elog(ERROR) stops the query? Now my functions return zero values for
illegal input. Anyway, I will use binary access to the data.. I wonder
how does an array look in binary? Is this an easy thing to find in the
source?

--
Players win and Winners play
Have a lucky day

Вложения

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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: A couple of pgsql questions
Следующее
От: Brian Edginton
Дата:
Сообщение: [HACKERS] pg_connect error