Re: Possible bug in plpgsql/src/gram.y - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Possible bug in plpgsql/src/gram.y
Date
Msg-id 10786.994905613@sss.pgh.pa.us
Whole thread Raw
In response to Re: Possible bug in plpgsql/src/gram.y  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Possible bug in plpgsql/src/gram.y
Re: Possible bug in plpgsql/src/gram.y
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Also, can someone tell my why we use malloc in plpgsql?

Plain palloc() won't do because the compiled tree for the function needs
to outlive the current query.  However, malloc() is not cool.  Really,
these structures ought to be built in a memory context created specially
for each function --- then it'd be possible to reclaim the memory if the
function is deleted or we realize we need to invalidate its compiled
tree.

I've had this in mind to do for awhile, but haven't gotten to it.
Do you want to put it on TODO?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Strangeness in xid allocation / snapshot setup
Next
From: Tatsuo Ishii
Date:
Subject: Re: iconv?