Re: POC: converting Lists into arrays

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Jesper Pedersen <jesper(dot)pedersen(at)redhat(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: POC: converting Lists into arrays
Date: 2019-07-21 20:01:45
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I wrote:
>> * Rationalize places that are using combinations of list_copy and
>> list_concat, probably by inventing an additional list-concatenation
>> primitive that modifies neither input.

> I poked around to see what we have in this department. There seem to
> be several identifiable use-cases:
> [ ... analysis ... ]

Here's a proposed patch based on that. I added list_concat_copy()
and then simplified callers as appropriate.

It turns out there are a *lot* of places where list_concat() callers
are now leaking the second input list (where before they just leaked
that list's header). So I've got mixed emotions about the choice not
to add a variant function that list_free's the second input. On the
other hand, the leakage probably amounts to nothing significant in
all or nearly all of these places, and I'm concerned about the
readability/understandability loss of having an extra version of
list_concat. Anybody have an opinion about that?

Other than that point, I think this is pretty much good to go.

regards, tom lane

Attachment Content-Type Size
rationalize-list-concat-and-copy-operations-1.patch text/x-diff 29.9 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Chapman Flack 2019-07-21 20:44:37 Re: The flinfo->fn_extra question, from me this time.
Previous Message Stephen Frost 2019-07-21 18:25:29 Re: Bad canonicalization for dateranges with 'infinity' bounds