When a PostgreSQL pg_dump
is done it inserts some comments for each element, as follows.
--
-- Name: my_table; Type: TABLE; Schema: account; Owner: user; Tablespace:
--
CREATE TABLE my_table(
id integer
);
--
-- Name: my_seq; Type: SEQUENCE; Schema: account; Owner: user
--
CREATE SEQUENCE my_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
Is it possible to force pg_dump
to remove (exclude) them? I would like to receive just:
CREATE TABLE my_table(
id integer
);
CREATE SEQUENCE my_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
I've just submitted this patch for Postgres 11+ (still under consideration) that should allow one to dump without COMMENTS (until an ideal solution is in place) which should be a slightly better kludge than the ones we resort to using.
If there are enough voices, it may even get back-patched to Postgres 10!
[UPDATE]
This is now a feature in Postgres v11+
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With