# Backups fail with Postgres 16 database (and all PG\>13)

**URL:** <https://meta.discourse.org/t/backups-fail-with-postgres-16-database-and-all-pg-13/343432>\
**Category:** Product Support\
**Created:** [December 19, 2024, 5:58pm UTC](https://meta.discourse.org/t/backups-fail-with-postgres-16-database-and-all-pg-13/343432 "2024-12-19T17:58:38Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)\
**Post date:** [December 19, 2024, 6:55pm UTC](https://meta.discourse.org/t/backups-fail-with-postgres-16-database-and-all-pg-13/343432/2 "2024-12-19T18:55:02Z")

</div>

> [@pfaffman](#):
>
> Is this solving a problem?

Yep, that seems to be the case.

From the [PR](https://github.com/discourse/discourse_docker/pull/892):

> I discovered this bug when a Discourse backup was taken using `pg_dump` versioned 17.2 which cannot be restored onto postgres clusters \< 17.2.

Seems like you’re between a rock and a hard place here ([PostgreSQL: Documentation: 18: pg\_dump](https://www.postgresql.org/docs/current/app-pgdump.html))

> Because pg\_dump is used to transfer data to newer versions of PostgreSQL, the output of pg\_dump can be expected to load into PostgreSQL server versions newer than pg\_dump’s version. pg\_dump can also dump from PostgreSQL servers older than its own version. (Currently, servers back to version 9.2 are supported.) However, pg\_dump cannot dump from PostgreSQL servers newer than its own major version; it will refuse to even try, rather than risk making an invalid dump. Also, it is not guaranteed that pg\_dump’s output can be loaded into a server of an older major version — not even if the dump was taken from a server of that version. Loading a dump file into an older server may require manual editing of the dump file to remove syntax not understood by the older server.

---

_[View the full topic](https://meta.discourse.org/t/backups-fail-with-postgres-16-database-and-all-pg-13/343432)._
