Re: How to allocate space to structure instance

Поиск
Список
Период
Сортировка
От Rohit Goyal
Тема Re: How to allocate space to structure instance
Дата
Msg-id CANqGtSsgmxn2RDVKpx+oS3QyvCETXh7rL7pQ3etUD03eY2cPrg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to allocate space to structure instance  (amul sul <sul_amul@yahoo.co.in>)
Ответы Re: How to allocate space to structure instance  (amul sul <sul_amul@yahoo.co.in>)
Список pgsql-novice



On Wed, Dec 11, 2013 at 5:42 AM, amul sul <sul_amul@yahoo.co.in> wrote:
 
>Am I using wrong memory context? Or
is there anything else also I should keep in mind.

Yes it might be. Memory context of
transaction is deleted at the end.
If you want to preserved the information, you can allocated space for structure before begin transaction call.


Regards,
Amul Sul

Hi, 

Can you please tel me the location in code where I can allocate space before begin transaction call?

Right now, I am using spi_palloc function to alloctae memory to my structure instance. I want to insert 10 rows in a table and want to store the corresponding transaction ID in one link list. But, I am not able to store them in a link list I alway loose the previous information and hence cannot traverse the linklist to store new transaction Id at the end of link list

Some senior in my course said, I am using wrong memory context. Can anyone explain me the actual problem?

I have defined my struct in a header file and trying to create a simple link list in one .c file.
 
Regards,
Rohit Goyal

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

Предыдущее
От: amul sul
Дата:
Сообщение: Re: How to allocate space to structure instance
Следующее
От: amul sul
Дата:
Сообщение: Re: How to allocate space to structure instance