Re: making tsearch2 dictionaries

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: making tsearch2 dictionaries
Дата
Msg-id 25708.1076945172@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: making tsearch2 dictionaries  (Ben <bench@silentmedia.com>)
Ответы Re: making tsearch2 dictionaries  (Teodor Sigaev <teodor@sigaev.ru>)
Список pgsql-general
Ben <bench@silentmedia.com> writes:
> Okay, so I was actually able to answer this question on my own, in a
> manner of speaking. It seems the way to do this is to merely return a
> larger char** array, with one element for each word. But I was having
> trouble with postgres crashing, because (I think) it tries to free each
> element independently before using all of them. I had set each element
> to a different null-terminated chunk of the same palloc'd memory
> segment. Having never written C stored procs before, I take it that's
> bad practice?

Given Teodor's response, I think the issue is probably that you were
palloc'ing in too short-lived a context.  But whatever the problem is,
you'll narrow it down a lot faster if you build with --enable-cassert.
I wouldn't ever recommend trying to debug C functions without that.

            regards, tom lane

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

Предыдущее
От: Terry Lee Tucker
Дата:
Сообщение: Re: Dazed and Confused
Следующее
От: Mikhail Terekhov
Дата:
Сообщение: Re: Using NOTIFY... Slow Client Querys