Re: Rationalizing code-sharing among src/bin/ directories

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Rationalizing code-sharing among src/bin/ directories
Date: 2016-03-25 00:13:26
Message-ID: CAB7nPqStOVT=mAkaVGaf0P=gCFznvQORZNQL216g4ZS51wsW2A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 25, 2016 at 1:11 AM, Alvaro Herrera
<alvherre(at)2ndquadrant(dot)com> wrote:
> Tom Lane wrote:
>
>> What I propose doing is leaving the above-listed items in
>> pg_dump/dumputils.h/.c, and moving the rest of what's in those files
>> to new files src/include/fe_utils/string_utils.h and
>> src/fe_utils/string_utils.c.
>
> Seems reasonable.
>
>> This name is a bit arbitrary, but most of what's there is string
>> processing of some flavor or other, with some list processing thrown
>> in for good measure. If anyone's got a different color to paint this
>> bikeshed, please speak up.
>
> I wondered about the list stuff while messing about in pg_dump awhile
> ago. It seems moderately okay, but not terribly generic; maybe we
> should get rid of all that stuff and make ilist.c available to frontend.
> Not sure how easy is that, given that AFAIR ilist uses elog. Anyway
> maybe we can discuss that in the future, to avoid blocking your patch.

Definitely worth it, list mimics of what is in pg_dump are located in
pg_basebackup, and since a 9.6 patch in psql as well. That's as much
code duplication.

Preventing the use of elog in the frontend is something that has been
addressed multiple times with FRONTEND, so that's not likely going to
be an issue I think. Andres has mentioned as well having some elog
stuff available in frontend..
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2016-03-25 00:22:49 Re: [WIP] Effective storage of duplicates in B-tree index.
Previous Message Peter Geoghegan 2016-03-24 22:38:18 Re: Using quicksort for every external sort run