[HACKERS] proposal - pg_dump: flag to suppress output of SQL comments

Поиск
Список
Период
Сортировка
От Malcolm Locke
Тема [HACKERS] proposal - pg_dump: flag to suppress output of SQL comments
Дата
Msg-id 20171107015142.GA7182@naboo
обсуждение исходный текст
Ответы Re: [HACKERS] proposal - pg_dump: flag to suppress output of SQL comments
Список pgsql-hackers
Hello Hackers,

Would a patch to add a flag to pg_dump to suppress the output of SQL
comments be likely to be accepted?


So for example `pg_dump`:
 -- -- Name: foos; Type: TABLE; Schema: public; Owner: - --
 CREATE TABLE foos ( ...


With `pg_dump --no-sql-comments` Would become:
 CREATE TABLE foos ( ...


The rationale behind this is that we use schema dumps committed to VCS
to ensure database structures are synchronised among teams of
developers.

The SQL generated by pg_dump seems to be fairly constant between
Postgres versions, however the structure of the SQL comments in the
dumps changes quite frequently between Postgres versions.  This creates
a lot of churn on these structure files, unrelated to actual changes in
the database structure, in our VCS when developers are using different
versions of Postgres.  Note this is all via Ruby on Rails so we are not
the only users affected.

We could strip comments after the dump has been generated but this is
not ideal as without parsing the dump file we can't know if a line
beginning with -- is a comment or a string literal.

I'm happy to have a crack at a patch to pg_dump if it would be likely to
be accepted.

Cheers,

Malc


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Lucas B
Дата:
Сообщение: Re: [HACKERS] Early locking option to parallel backup
Следующее
От: David Rowley
Дата:
Сообщение: Re: [HACKERS] path toward faster partition pruning