Re: c extension

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: c extension
Дата
Msg-id 4188F207.3030702@joeconway.com
обсуждение исходный текст
Ответ на c extension  (Kjetil Haaland <kjetil.haaland@student.uib.no>)
Ответы Re: c extension  (Kjetil Haaland <kjetil.haaland@student.uib.no>)
Список pgsql-novice
Kjetil Haaland wrote:
> I am writing a c extension function to my postgres database and in this i am
> trying to allocate memory space for a table of char. When i try to call a
> function that returns a value from this table postgres crashes. It works fine
> running it as c code. I have added part of the code and hope that someone can
> help me.

>     scoreChar = (char*)palloc(20*sizeof(char));

It doesn't look like that palloc is done in a sufficiently long-lived
memory context. Read up on them in src/backend/utils/mmgr/README.

Joe

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

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: building a row with a plpgsql function
Следующее
От: Raphael Bauduin
Дата:
Сообщение: Re: building a row with a plpgsql function