Re: [HACKERS] Patch: Add --no-comments to skip COMMENTs with pg_dump

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Fabrízio Mello <fabriziomello(at)gmail(dot)com>, Robins Tharakan <tharakan(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, David Fetter <david(at)fetter(dot)org>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Subject: Re: [HACKERS] Patch: Add --no-comments to skip COMMENTs with pg_dump
Date: 2018-01-24 16:47:31
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I wrote:
> I went looking and realized that actually what we're interested in here
> is the plpgsql extension, not the plpgsql language ... and in fact the
> behavior I was thinking of is already there, except for some reason it's
> only applied during binary upgrade. So I think we should give serious
> consideration to the attached, which just removes the binary_upgrade
> condition (and adjusts nearby comments).

In further testing of that, I noticed that it made the behavior of our
other bugaboo, the public schema, rather inconsistent. With this
builtin-extensions hack, the plpgsql extension doesn't get dumped,
whether or not you say "clean". But the public schema does get
dropped and recreated if you say "clean". That's not helpful for
non-superuser users of pg_dump, so I think we should try to fix it.

Hence, the attached updated patch also makes selection of the public
schema use the DUMP_COMPONENT infrastructure rather than hardwired

I note btw that the removed bit in getNamespaces() is flat out wrong
independently of these other considerations, because it makes the SQL
put into an archive file vary depending on whether --clean was specified
at pg_dump time. That's not supposed to happen.

I've also updated the regression test this time, as I think this
is committable.

regards, tom lane

Attachment Content-Type Size
improve-pg-dump-handling-of-builtin-objects.patch text/x-diff 16.5 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Arthur Zakirov 2018-01-24 17:20:41 Re: [PROPOSAL] Shared Ispell dictionaries
Previous Message Alvaro Herrera 2018-01-24 16:20:06 Re: [HACKERS] Proposal: Local indexes for partitioned table