Re: [GENERAL] Many Pl/PgSQL parameters -> AllocSetAlloc(128)? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [GENERAL] Many Pl/PgSQL parameters -> AllocSetAlloc(128)?
Date
Msg-id 19367.1056466269@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] Many Pl/PgSQL parameters -> AllocSetAlloc(128)?  (Joe Conway <mail@joeconway.com>)
Responses Re: [GENERAL] Many Pl/PgSQL parameters -> AllocSetAlloc(128)?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Joe Conway <mail@joeconway.com> writes:
> Actually, adding a "pfree(oneres);" to the end of that for loop plugs
> the memory leak and allows me to see the error message:

On second look, you can't pfree oneres at the bottom of
gen_cross_product() because it's part of the returned data structure
--- note the assignment
        *iter++ = oneres;

I think the bug here is that gen_cross_product should be ignoring
argument positions that have nsupers == 0; those should always be
assigned the same type as the input, since the regular type resolution
algorithm is responsible for dealing with 'em.

It might work to get rid of the "wild card" case (line 1115), which'd
reduce the number of outputs to product(nsupers+1).  I doubt we really
want any wild cards in there anymore.

            regards, tom lane

pgsql-hackers by date:

Previous
From: Larry Rosenman
Date:
Subject: Re: interval's and printing...
Next
From: Tatsuo Ishii
Date:
Subject: Re: lru cache replacement