Dump all databases

pg_dumpall

  • Extract a PostgreSQL database cluster into a script file or other archive file.
    More information: <https://www.postgresql.org/docs/current/app-pg-dumpall.html>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

pg_dumpall > {{path/to/file.sql}}

click the source code to copy install pg_dumpall on any operating system with command-not-found.com