Search Postgresql Archives

Re: I think that my data is saved correctly, but when printing again, other data appears

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2019-10-25 at 22:06 -0300, Yessica Brinkmann wrote:
> What I do not understand well is how to use CurrentMemoryContext and MemoryContextStrdup

For examples using memotry contexts, search the PostgreSQL source code.

To make memory management easier and safer, PostgreSQL has implemented
its own memory management using "memory contexts".

If you allocate memoty with "palloc", "pstrdup" and similar, that memory
is allocated in the current memory context.  If the memory context is
reset or dropped, the memory is gone.

MemoryContextStrdup enables you to create a copy of a string in an
explicitly specified memory context.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux