Re: Re[2]: [BUGS] BUG #11761: range_in dosn't work via direct functional call - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Re[2]: [BUGS] BUG #11761: range_in dosn't work via direct functional call
Date
Msg-id 6758.1414252645@sss.pgh.pa.us
Whole thread Raw
In response to Re[2]: [BUGS] BUG #11761: range_in dosn't work via direct functional call  (Dunauskas Oleg <olegjobs@mail.ru>)
List pgsql-bugs
=?UTF-8?B?RHVuYXVza2FzIE9sZWc=?= <olegjobs@mail.ru> writes:
> And one more question, for example, I do some memory allocation via palloc in _PG_Init().
> Is this memory preserve for all life time after library is loaded into postgresql process?

Probably not --- CurrentMemoryContext would most likely be pointing at a
statement-lifespan context.  If you want that behavior, I'd recommend
explicitly allocating in TopMemoryContext.

(Also, you would not be needing to ask that question if you were using
an --enable-cassert build for testing.  Which is *highly* recommended
when developing C code for Postgres.)

            regards, tom lane



pgsql-bugs by date:

Previous
From: Dunauskas Oleg
Date:
Subject: Re[2]: [BUGS] BUG #11761: range_in dosn't work via direct functional call
Next
From: Heikki Linnakangas
Date:
Subject: tsquery @> operator bugs