Greetings, * Robins Tharakan (thara...@gmail.com) wrote: > 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.
Having --no-comments seems generally useful to me, in any case. > A similar discussion had taken place earlier , however that stopped > (with a Todo entry) since it required more work at the backend. Well, that was one possible solution (COMMENT IF NOT EXISTS). That does seem like it'd be nice too, though what I think we really want here is something like: CREATE EXTENSION IF NOT EXISTS plpgsql ... COMMENT blah; That general capability has been asked for and discussed before, but it's complicated because we support comments on lots of objects and doesn't address other possible issues with this approach (comments aren't the only things that could exist on plpgsql, and I can't see us having a way to get every component included in a single command...). That leads to an interesting thought which we could consider, which would be represented in some crazy syntax such as: CREATE EXTENSION IF NOT EXISTS plpgsql ... ( COMMENT xyz; GRANT USAGE ON EXTENSION plpgsql whatever; ); > 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. That seems like it might be a bit too specific. > Alternatively, if there are no objections, I could submit this to the > Commitfest. Yes, please add it to the commitfest. Thanks! Stephen
Description: Digital signature