# PostgreSQL - Upgrade

## **PaaS upgrade workflow** <a href="#redisupgradeinplace-redispaasupgrade" id="redisupgradeinplace-redispaasupgrade"></a>

### Request <a href="#postgresqlupgradeinplace-request" id="postgresqlupgradeinplace-request"></a>

The update of a PostgreSQL PaaS is the responsibility of **cegedim.cloud** and can be requested via a [request ticket](https://itcare.cegedim.cloud/support?createTicket=true\&requestTypeIndex=3\&formName=DB_POSTGRES\&step=Request) submitted from ITCare, specifying a time slot for the operation.

Please specify if the operation is to be carried out outside of business hours in order to plan an RFC.

It is recommended that you upgrade your non-production environments first in order to estimate the downtime generated by the operation and to test your applications using the new engine version.

### Process <a href="#postgresqlupgradeinplace-process" id="postgresqlupgradeinplace-process"></a>

The upgrade of a PostgreSQL deployment (single-instance or high availability) takes place in two fully automated steps:

* Update the Operating system first if required
  * Multiple updates depending on the scenario: Debian 10 → Debian 11 -> Debian 12 -> Debian 13
* Update of the PostgreSQL engine in the target version

Depending on the source and target versions of PostgreSQL, it may be necessary to first migrate the operating system to a version supported by **cegedim.cloud** (for more information, check [#postgresqlupgradeinplace-os-postgresqlsupportmatrixmatrice](#postgresqlupgradeinplace-os-postgresqlsupportmatrixmatrice "mention")).

<figure><picture><source srcset="https://835168969-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2FXoHyOBZPpJv3UALn4V%2Fuploads%2Fgit-blob-3728f552d038559a657b9671e3daec6d0e1aac95%2Fdark_eng%20(17).png?alt=media" media="(prefers-color-scheme: dark)"><img src="https://835168969-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2FXoHyOBZPpJv3UALn4V%2Fuploads%2Fgit-blob-1d63c89af26ea8564189571ce6cd842036cc1d3f%2Flight_eng%20(7).png?alt=media" alt="" width="563"></picture><figcaption></figcaption></figure>

### Impacts

* The duration of an update is variable depending on:
  * The configured cpu and ram resources
  * The amount of data whose headers must be modified by the PostgreSQL engine.
  * The amount of data to be reindexed following a change of C library, after an OS update.
  * The amount of data on which to activate the checksum (data page checksum was activated since PaaS PostgreSQL 12 )
  * The amount of data to be vacuumed.
  * The amount of data to be backuped (a full backup is performed after migration process).
* The backup mode:
  * Point-in-time Recovery (PITR) from PostgreSQL 12 and higher.
    * The "dump" backup mode disappears in favour of the "PITR" and is only used in versions of PostgreSQL lower than version 12.

### Time references <a href="#postgresqlupgradeinplace-timereferences" id="postgresqlupgradeinplace-timereferences"></a>

As an average guideline, durations for each steps of an upgrade in place of a 100 GB [pgbench](https://www.postgresql.org/docs/current/pgbench.html) database:

* Debian upgrade: 10 minutes on average
* PostgreSQL reindexing: 5 minutes on average
* PostgreSQL upgrading: 1 minute on average
* PostgreSQL checksum: 3 minutes on average
* PostgreSQL vacuuming: 1 minute on average
* PostgreSQL full backup (PITR mode): 16 minutes on average

In PostgreSQL HA, we need to upgrade the replica too and synchronize this replica with the leader:

* PostgreSQL synchronizing: 4 minutes on average

Total average duration for a 100GB database: 40 minutes

## **OS / PostgreSQL support matrix** <a href="#postgresqlupgradeinplace-os-postgresqlsupportmatrixmatrice" id="postgresqlupgradeinplace-os-postgresqlsupportmatrixmatrice"></a>

Linux distributions supported by **cegedim.cloud** depending on the PostgreSQL version:

<table><thead><tr><th width="223">PostgreSQL version</th><th>Debian distribution</th></tr></thead><tbody><tr><td>PostgreSQL 12</td><td>Debian 10</td></tr><tr><td>PostgreSQL 13</td><td>Debian 11</td></tr><tr><td>PostgreSQL 14</td><td>Debian 11</td></tr><tr><td>PostgreSQL 15</td><td>Debian 11</td></tr><tr><td>PostgreSQL 16</td><td>Debian 12</td></tr><tr><td>PostgreSQL 17</td><td>Debian 13</td></tr><tr><td>PostgreSQL 18</td><td>Debian 13</td></tr></tbody></table>

## **Supported PostgreSQL update paths** <a href="#postgresqlupgradeinplace-supportedpostgresqlupdatepaths" id="postgresqlupgradeinplace-supportedpostgresqlupdatepaths"></a>

If the operating system is updated, it may require a complete reindexing (also handled by **cegedim.cloud**) due to changes in the C library when the operating system is updated.

Depending on the amount of data, this operation may take some time.

Below are the update paths supported by **cegedim.cloud**:

<table data-full-width="true"><thead><tr><th width="181">Version Source</th><th>PostgreSQL 13</th><th>PostgreSQL 14</th><th>PostgreSQL 15</th><th>PostgreSQL 16</th><th>PostgreSQL 17</th><th>PostgreSQL 18</th></tr></thead><tbody><tr><td>PostgreSQL 12</td><td><p><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span><strong>*</strong></p><p>Debian 10 → Debian 11</p></td><td><p><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span><strong>*</strong></p><p>Debian 10 → Debian 11</p></td><td><p><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span><strong>*</strong></p><p>Debian 10 → Debian 11</p></td><td><p><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span><strong>**</strong></p><p>Debian 10 → Debian 12</p></td><td><p><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span><strong>***</strong></p><p>Debian 10 → Debian 13</p></td><td><p><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span><strong>***</strong></p><p>Debian 10 → Debian 13</p></td></tr><tr><td>PostgreSQL 13</td><td></td><td><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td><p><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span><strong>*</strong></p><p>Debian 11 → Debian 12</p></td><td><p><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span><strong>**</strong></p><p>Debian 11 → Debian 13</p></td><td><p><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span><strong>**</strong></p><p>Debian 11 → Debian 13</p></td></tr><tr><td>PostgreSQL 14</td><td></td><td></td><td><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td><p><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span><strong>*</strong></p><p>Debian 11 → Debian 12</p></td><td><p><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span><strong>**</strong></p><p>Debian 11 → Debian 13</p></td><td><p><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span><strong>**</strong></p><p>Debian 11 → Debian 13</p></td></tr><tr><td>PostgreSQL 15</td><td></td><td></td><td></td><td><p><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span><strong>*</strong></p><p>Debian 11 → Debian 12</p></td><td><p><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span><strong>**</strong></p><p>Debian 11 → Debian 13</p></td><td><p><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span><strong>**</strong></p><p>Debian 11 → Debian 13</p></td></tr><tr><td>PostgreSQL 16</td><td></td><td></td><td></td><td></td><td><p><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span><strong>***</strong></p><p>Debian 12 → Debian 13</p></td><td><p><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span><strong>***</strong></p><p>Debian 12 → Debian 13</p></td></tr><tr><td>PostgreSQL 17</td><td></td><td></td><td></td><td></td><td></td><td><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td></tr></tbody></table>

**\*** An operating system upgrade is required

**\*\*** Two operating system upgrades are required

**\*\***\* Three operating system upgrades are required


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://academy.cegedim.cloud/databases/postgresql/postgresql-upgrade.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
