From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: some more pg_dump refactoring
Date: Thu, 25 Jun 2020 08:58:58 +0200 (CEST)
Message-ID: <alpine.DEB.2.22.394.2006250820020.2939276@pseudo> (raw)
In-Reply-To: <6594334b-40fd-14f1-6bc5-877afa3feed5@2ndquadrant.com>
References: <6594334b-40fd-14f1-6bc5-877afa3feed5@2ndquadrant.com>
Hallo Peter,
My 0.02 €:
Patch applies cleanly, compiles, make check and pg_dump tap tests ok. The
refactoring is a definite improvements.
You changed the query strings to use "\n" instead of " ". I would not have
changed that, because it departs from the style around, and I do not think
it improves readability at the C code level.
I tried to check manually and randomly that the same query is built for
the same version, although my check may have been partial, especially on
the aggregate query which does not comment about what is changed between
versions, and my eyes are not very good at diffing.
I've notice that some attributes are given systematic replacements (eg
proparallel), removing the need to test for presence afterwards. This
looks fine to me.
However, on version < 8.4, ISTM that funcargs and funciargs are always
added: is this voluntary?.
Would it make sense to accumulate in the other direction, older to newer,
so that new attributes are added at the end of the select?
Should array_to_string be pg_catalog.array_to_string? All other calls seem
to have an explicit schema.
I'm fine with inlining most PQfnumber calls.
I do not have old versions at hand for testing.
> Here is a patch to reorganize dumpFunc() and dumpAgg() in pg_dump, similar to
> daa9fe8a5264a3f192efa5ddee8fb011ad9da365. Instead of repeating the almost
> same large query in each version branch, use one
> query and add a few columns to the SELECT list depending on the
> version. This saves a lot of duplication.
>
> I have tested this with various old versions of PostgreSQL I had available,
> but a bit more random testing with old versions would be welcome.
--
Fabien.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: coelho@cri.ensmp.fr, peter.eisentraut@2ndquadrant.com
Subject: Re: some more pg_dump refactoring
In-Reply-To: <alpine.DEB.2.22.394.2006250820020.2939276@pseudo>
References: <6594334b-40fd-14f1-6bc5-877afa3feed5@2ndquadrant.com> <alpine.DEB.2.22.394.2006250820020.2939276@pseudo>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox