pgsql: Minor cleanup/optimization in pg_dump.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Minor cleanup/optimization in pg_dump.
Date: 2021-12-30 19:29:41
Message-ID: E1n317N-0001a2-Kr@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Minor cleanup/optimization in pg_dump.

In the wake of commits 05649b88c and 5209c0ba0, findComments() and
findSecLabels() no longer use their "Archive *fout" arguments,
so get rid of those.

While doing that, I noticed that there's no very good reason why
dumpCompositeTypeColComments() should be doing its own query to fetch
the column names of the composite type, when the calling function has
just fetched the same data. Tweak it to use that query result. This
probably doesn't save a lot for most people, because since 5209c0ba0
we won't get into this code at all unless the composite type has at
least one comment. Nonetheless, it's a wasted query.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c7cf73eb7b9e7911748ebe117a7219f21e504121

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 84 ++++++++++++++++-------------------------------
1 file changed, 29 insertions(+), 55 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2021-12-30 22:40:12 pgsql: Small cleanups related to PUBLICATION framework code
Previous Message Daniel Gustafsson 2021-12-30 12:26:43 pgsql: Revert b2a459edf "Fix GRANTED BY support in REVOKE ROLE statemen