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