Patch: Add --no-comments to skip COMMENTs with pg_dump

From: Robins Tharakan <tharakan(at)gmail(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Patch: Add --no-comments to skip COMMENTs with pg_dump
Date: 2017-05-26 13:58:57
Message-ID: CAEP4nAx22Z4ch74oJGzr5RyyjcyUSbpiFLyeYXX8pehfou92ug@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Attached is a patch adds a --no-comments argument to pg_dump to skip
generation of COMMENT statements when generating a backup. This is crucial
for non-superusers to restore a database backup in a Single Transaction.
Currently, this requires one to remove COMMENTs via scripts, which is
inelegant at best.

A similar discussion had taken place earlier [1], however that stopped
(with a Todo entry) since it required more work at the backend.

This patch provides a stop-gap solution until then. If the feedback is to
tackle this is by filtering comments for specific DB objects, an argument
name (for e.g. --no-extension-comments or something) would help and I could
submit a revised patch.

Alternatively, if there are no objections, I could submit this to the
Commitfest.

References:
[1] https://www.postgresql.org/message-id/1420.1397099637%40sss.pgh.pa.us

-
robins
​​

Attachment Content-Type Size
pgdump_nocomments_v1.patch application/octet-stream 3.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Petr Jelinek 2017-05-26 13:59:03 Re: logical replication - still unstable after all these months
Previous Message Daniel Gustafsson 2017-05-26 12:36:38 Bug when dumping "empty" operator classes