Preventing ecto structure.sql from including local machine information


I’m trying to prevent our structure.sql files from showing apparent changes every time a migration is run on a different operating system.

At the moment it outputs

-- Dumped by pg_dump version 14.5 (Ubuntu 14.5-0ubuntu0.22.04.1)

At the top of the file, which obviously changes between systems.

Is there any way of preventing this line being added? Or is this something that happens on postgres’s end that I can’t change?

Thanks in advance

If it matters, then sed it out is my suggestion.
Dont think you can flag it off anywhere.

1 Like

pg_dump has the --no-comments option, worth a try?

If not, just remove all lines starting with -- (two dashes AND a space) with sed and you should be fine.

This doesn’t suppress comments which pg_dump generates, just those that you may have added yourself via COMMENT ON <object>. I don’t believe there is a way to suppress the
pg_dump generated comments.

1 Like