Re: WIP: pl/pgsql cleanup - Mailing list pgsql-patches

From Tom Lane
Subject Re: WIP: pl/pgsql cleanup
Date
Msg-id 27129.1107790885@sss.pgh.pa.us
Whole thread Raw
In response to Re: WIP: pl/pgsql cleanup  (Neil Conway <neilc@samurai.com>)
Responses Re: WIP: pl/pgsql cleanup  (Neil Conway <neilc@samurai.com>)
List pgsql-patches
Neil Conway <neilc@samurai.com> writes:
> - abandonded the falloc() idea. There really aren't that many
> short-lived allocations in the PL/PgSQL compiler, and using falloc()
> made it difficult to use List. Instead, make the CurrentMemoryContext
> the long-lived function context, and explicitly pfree short-term
> allocations. Not _all_ short-lived allocations are explicitly released;
> if this turns out to be a problem, it can be cleaned up later.

My recollection is that I was not nearly as worried about short-term
pallocs in the plpgsql code itself, as about leakage in various main-
backend routines that get called incidentally during parsing.
backend/parser/ is quite cavalier about this as a whole, because it
expects to be called in contexts that are not long-lived.  Have you
done any checking to ensure that the per-function context doesn't get
unreasonably bloated this way?

            regards, tom lane

pgsql-patches by date:

Previous
From: "Ameen - Etemady"
Date:
Subject: Re: again: add collation support function
Next
From: Bruce Momjian
Date:
Subject: Re: again: add collation support function